/* ===== 기본 ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #1b1d33;
  color: #efe9da;
  /* 인터넷 글꼴은 쓰지 않는다. 컴퓨터에 Galmuri가 있으면 쓰고, 없으면 기본 고정폭 글꼴 */
  font-family: 'Galmuri11', 'Galmuri9', monospace;
  /* 한국어 낱말이 중간에서 끊기지 않게 한다 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2,
p {
  margin: 0;
}

.page {
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===== 맨 위 배너 ===== */
#game-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 14px 20px;
  background-color: #262a48;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 46px, #2d3253 46px 48px),
    repeating-linear-gradient(0deg, transparent 0 22px, #2d3253 22px 24px);
  border: 3px solid #6d58b8;
  box-shadow: 0 4px 0 #11121f;
}

#game-banner h1 {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 1px;
  color: #e4dbff;
  text-shadow: 3px 3px 0 #4b3a8c, -1px -1px 0 #11121f;
}

#game-banner p {
  flex: 1 1 240px;
  font-size: 15px;
  color: #efe9da;
}

/* ===== 세 칸 ===== */
.columns {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.col-game {
  flex: 0 0 auto;
}

.panel {
  flex: 1 1 300px;
  min-width: 0;
  padding: 20px;
  background: #262a48;
  border: 3px solid #6d58b8;
  box-shadow: 0 4px 0 #11121f;
  display: flex;
  flex-direction: column;
}

.panel h2 {
  font-size: 18px;
  color: #c6b4ff;
}

/* ===== 왼쪽 칸: 게임 자리 ===== */
#game-slot {
  position: relative;
  aspect-ratio: 9 / 16;
  /* 컴퓨터 화면에서 스크롤 없이 다 보이도록, 화면 높이에 맞춰 줄어든다 */
  height: min(675px, calc(100vh - 165px));
  min-height: 360px;
  overflow: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background-color: #22263f;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 30px, #1a1d31 30px 33px),
    repeating-linear-gradient(90deg, transparent 0 60px, #1a1d31 60px 63px);
  border: 3px solid #6d58b8;
  box-shadow: 0 4px 0 #11121f;
}

.deco-door {
  position: absolute;
  top: 18%;
  width: 46px;
  height: 62px;
  background: #151729;
  border: 3px solid #4b5078;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
}

.deco-door-left {
  left: 14%;
}

.deco-door-right {
  right: 14%;
}

.deco-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12%;
  background-color: #8b72d6;
  background-image: repeating-linear-gradient(90deg, transparent 0 38px, #6d58b8 38px 41px);
  border-top: 4px solid #b9a6f2;
}

.deco-spikes {
  position: absolute;
  left: 30%;
  bottom: 12%;
  display: flex;
  gap: 6px;
}

.deco-spikes span {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 16px solid #d9d4e8;
}

.slot-label {
  position: relative;
  padding: 8px 12px;
  font-size: 16px;
  color: #c9c3e0;
  text-align: center;
  background: #151729;
  border: 2px dashed #4b5078;
}

.start-button {
  position: relative;
  padding: 12px 28px;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  color: #1b1d33;
  background: #ffe7a8;
  border: 3px solid #11121f;
  box-shadow: 0 5px 0 #c98f3d;
  cursor: pointer;
}

.start-button:hover {
  background: #fff3cf;
}

.start-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c98f3d;
}

/* ===== 가운데 칸: 게임 소개 ===== */
#game-about {
  gap: 18px;
}

.about-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.about-block p {
  font-size: 14px;
  line-height: 1.7;
}

.about-block .mood {
  font-size: 13px;
  line-height: 1.6;
  color: #b8b2d1;
}

.dash-line {
  height: 3px;
  background: repeating-linear-gradient(90deg, #4b5078 0 8px, transparent 8px 14px);
}

.keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.key {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #1b1d33;
  background: #efe9da;
  border: 2px solid #11121f;
  box-shadow: 0 3px 0 #8d87a8;
}

.key-text {
  font-size: 14px;
}

.info {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 16px;
  font-size: 14px;
}

.info dt {
  color: #b8b2d1;
}

.info dd {
  margin: 0;
}

/* ===== 오른쪽 칸: 점수 ===== */
.score-panel {
  gap: 16px;
}

.score-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-form label {
  font-size: 13px;
  color: #b8b2d1;
}

.score-form input {
  width: 100%;
  margin-bottom: 4px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  color: #efe9da;
  background: #151729;
  border: 2px solid #4b5078;
  outline: none;
}

.score-form input::placeholder {
  color: #7f7aa6;
}

.score-form input:focus {
  border-color: #c6b4ff;
}

#score-submit {
  padding: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #efe9da;
  background: #8b72d6;
  border: 3px solid #11121f;
  box-shadow: 0 4px 0 #4b3a8c;
  cursor: pointer;
}

#score-submit:hover {
  background: #9c85e3;
}

#score-submit:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #4b3a8c;
}

#scoreboard {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#scoreboard li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  font-size: 14px;
  background: #1b1d33;
  border: 2px solid #3a3f63;
}

#scoreboard .rank {
  color: #ffe7a8;
}

#scoreboard .score {
  color: #c6b4ff;
}

.score-message {
  min-height: 1em;
  font-size: 13px;
  color: #ffe7a8;
}

.score-notice {
  font-size: 12px;
  line-height: 1.6;
  color: #b8b2d1;
}

/* ===== 맨 아래: 댓글 (관리자 페이지도 같이 쓴다) ===== */
.comment-panel {
  gap: 16px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.comment-form label {
  font-size: 15px;
  font-weight: 700;
  color: #c6b4ff;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  margin-bottom: 4px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  color: #efe9da;
  background: #151729;
  border: 2px solid #4b5078;
  outline: none;
  resize: vertical;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: #7f7aa6;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: #c6b4ff;
}

.comment-form button,
.admin-actions button {
  padding: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #efe9da;
  background: #8b72d6;
  border: 3px solid #11121f;
  box-shadow: 0 4px 0 #4b3a8c;
  cursor: pointer;
}

.comment-form button:hover,
.admin-actions button:hover {
  background: #9c85e3;
}

.comment-form button:active,
.admin-actions button:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #4b3a8c;
}

.admin-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

#comment-list,
#admin-list,
#admin-score-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#comment-list li,
#admin-list li,
#admin-score-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  font-size: 14px;
  background: #1b1d33;
  border: 2px solid #3a3f63;
}

.comment-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.comment-label {
  flex: 0 0 auto;
  font-size: 12px;
  color: #b8b2d1;
}

.comment-label::after {
  content: ':';
}

.comment-name {
  color: #ffe7a8;
}

.comment-content {
  line-height: 1.6;
  white-space: pre-wrap;
}

#comment-list .comment-pending {
  color: #7f7aa6;
}

.admin-status {
  font-size: 12px;
  color: #c6b4ff;
}

.admin-actions {
  display: flex;
  gap: 8px;
}

.admin-actions button {
  padding: 6px 14px;
  font-size: 14px;
}

/* ===== 휴대폰 화면: 배너 → 게임 → 소개 → 점수 순서로 쌓기 ===== */
@media (max-width: 800px) {
  .page {
    padding: 16px;
    gap: 16px;
  }

  #game-banner h1 {
    font-size: 32px;
  }

  .columns {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .col-game {
    width: 100%;
    max-width: 380px;
    align-self: center;
  }

  #game-slot {
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .panel {
    flex: 0 0 auto;
  }
}
