/* ============================================================
   BADUK (바둑) Educational App Styles
   ============================================================ */

#baduk-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  user-select: none;
  font-family: inherit;
}

/* ============================================================
   SECTION VISIBILITY
   ============================================================ */
.baduk-section { display: none; }

/* ============================================================
   HOME SCREEN
   ============================================================ */
#home {
  width: min(480px, 92vw);
  text-align: center;
}

#home h2 {
  font-size: 22px;
  margin: 0 0 6px;
  color: #4a2c00;
}

#home p.home-desc {
  font-size: 14px;
  color: #666;
  margin: 0 0 20px;
  line-height: 1.5;
}

.home-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px 20px;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.home-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.home-card-title {
  font-size: 16px;
  font-weight: bold;
  color: #4a2c00;
  margin-bottom: 4px;
}

.home-card-desc {
  font-size: 13px;
  color: #888;
}

.home-card-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

/* ============================================================
   CANVAS
   ============================================================ */
#baduk-canvas {
  display: block;
  cursor: crosshair;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  touch-action: manipulation;
  max-width: 100%;
}

/* ============================================================
   STATUS BAR
   ============================================================ */
#game-status {
  width: min(480px, 92vw);
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  padding: 8px 12px;
  background: #fdf6e3;
  border: 1px solid #d4b483;
  border-radius: 6px;
  margin: 10px 0 6px;
  color: #4a2c00;
  line-height: 1.4;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-status.shake {
  animation: baduk-shake 0.3s ease;
}

@keyframes baduk-shake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-6px); }
  50%  { transform: translateX(6px); }
  75%  { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* ============================================================
   CONTROLS (shared)
   ============================================================ */
.baduk-controls {
  width: min(480px, 92vw);
  margin-top: 6px;
}

.ctrl-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.baduk-btn {
  padding: 7px 14px;
  border: 1px solid #c8a060;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #4a2c00;
  transition: background 0.15s, border-color 0.15s;
}

.baduk-btn:hover:not(:disabled) {
  background: #fdf0d0;
  border-color: #a0703a;
}

.baduk-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.baduk-btn.active {
  background: #8b5e2a;
  color: #fff;
  border-color: #6b3f10;
  font-weight: bold;
}

.size-btn { min-width: 56px; }

.primary-btn {
  background: #6b4011;
  color: #fff;
  border-color: #4a2c00;
  font-weight: bold;
  padding: 8px 22px;
}

.primary-btn:hover:not(:disabled) {
  background: #4a2c00;
}

.back-btn {
  font-size: 13px;
  color: #888;
  border-color: #ccc;
  padding: 5px 12px;
}

/* ============================================================
   FREE PLAY SECTION
   ============================================================ */
#free-play {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ctrl-label {
  font-size: 12px;
  color: #888;
  margin-bottom: 4px;
  display: block;
  text-align: center;
}

/* ============================================================
   TUTORIAL SECTION
   ============================================================ */
#tutorial-view {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tutorial-header {
  width: min(480px, 92vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

#tutorial-title {
  font-size: 16px;
  font-weight: bold;
  color: #4a2c00;
}

#tutorial-progress {
  font-size: 12px;
  color: #999;
}

.tutorial-text-box {
  width: min(480px, 92vw);
  background: #fffdf5;
  border: 1px solid #d4b483;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin: 8px 0;
  min-height: 70px;
}

.tut-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

/* ============================================================
   TUTORIAL LIST
   ============================================================ */
#tutorial-list {
  width: min(480px, 92vw);
}

#tutorial-list h3 {
  font-size: 16px;
  color: #4a2c00;
  margin: 0 0 12px;
  text-align: center;
}

.tut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e0c898;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.tut-item:hover { background: #fef7e4; }

.tut-item-num {
  font-size: 20px;
  font-weight: bold;
  color: #b8803a;
  min-width: 28px;
  text-align: center;
}

.tut-item-title {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}

.tut-item-steps {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}

/* ============================================================
   PROBLEM SECTION
   ============================================================ */
#problem-view {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#problem-header {
  width: min(480px, 92vw);
  margin-bottom: 6px;
}

#problem-title {
  font-size: 15px;
  font-weight: bold;
  color: #4a2c00;
  margin-bottom: 3px;
}

#problem-desc {
  font-size: 13px;
  color: #666;
}

#problem-result {
  width: min(480px, 92vw);
  font-size: 15px;
  font-weight: bold;
  text-align: center;
  min-height: 22px;
  margin: 4px 0;
}

#problem-hint {
  width: min(480px, 92vw);
  font-size: 13px;
  color: #888;
  min-height: 18px;
  text-align: center;
  margin-bottom: 4px;
}

.prob-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

#problem-nav {
  font-size: 13px;
  color: #aaa;
  min-width: 40px;
  text-align: center;
}

/* ============================================================
   PROBLEM LIST
   ============================================================ */
#problem-list {
  width: min(480px, 92vw);
}

#problem-list h3 {
  font-size: 16px;
  color: #4a2c00;
  margin: 0 0 12px;
  text-align: center;
}

.prob-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e0c898;
  border-radius: 8px;
  margin-bottom: 6px;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.prob-item:hover { background: #fef7e4; }

.prob-item-num {
  font-size: 13px;
  color: #b8803a;
  font-weight: bold;
  min-width: 28px;
  text-align: center;
}

.prob-item-title {
  font-size: 14px;
  color: #333;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 520px) {
  #game-status { font-size: 12px; }
  .baduk-btn { padding: 6px 10px; font-size: 12px; }
  .home-card-title { font-size: 14px; }
  .tutorial-text-box { font-size: 13px; }
}
