/* 색: Claude Design 시안(Game Page.dc.html)에서 가져왔다 */
:root {
  --page-bg: #2a1830;     /* 바깥 배경, 점수판 바탕 */
  --frame-line: #4a2a4f;  /* 페이지 테두리 */
  --paper: #fffafb;       /* 페이지 바탕 */
  --pink: #d6336c;        /* 배너, 순위 칸 */
  --pink-light: #e8588b;  /* 배너 동그라미 */
  --pink-soft: #f4a7b9;   /* 게임 자리 테두리 */
  --berry: #9e0b4f;       /* 본문 글자, 진한 선 */
  --berry-mid: #b8346f;   /* 분위기 글자 */
  --lime: #b8e04a;        /* 버튼, 점수 숫자 */
  --lime-light: #c9ec66;  /* 버튼에 마우스를 올렸을 때 */
  --green: #7fb81e;       /* 제작자 이름, 입력칸 포커스 */
  --placeholder: #c98aa8;

  /* 인터넷 글꼴 없이 컴퓨터에 있는 한글 글꼴을 쓴다 */
  --font: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  font-family: var(--font);
  color: var(--berry);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

input::placeholder { color: var(--placeholder); }

/* 바깥 틀 */
.page {
  min-height: 100vh;
  padding: 24px 16px 48px;
  display: flex;
  justify-content: center;
}
.frame {
  width: 100%;
  max-width: 1180px;
  background: var(--paper);
  box-shadow: 0 0 0 6px var(--frame-line);
  display: flex;
  flex-direction: column;
}

/* 배너 */
#game-banner {
  position: relative;
  overflow: hidden;
  background: var(--pink);
  color: #fff;
  padding: 22px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  border-bottom: 6px solid var(--berry);
}
#game-banner h1 {
  position: relative;
  margin: 0;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: 1px;
  text-shadow: 3px 3px 0 var(--berry);
}
#game-banner p {
  position: relative;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: #fff0f5;
}
.deco { position: absolute; }
.deco-big { right: -30px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: var(--pink-light); }
.deco-small { right: 90px; bottom: -50px; width: 90px; height: 90px; border-radius: 50%; background: var(--pink-light); }
.deco-diamond { right: 30px; top: 20px; width: 18px; height: 18px; background: var(--lime); transform: rotate(45deg); }

/* 세 칸 */
.columns {
  display: grid;
  grid-template-columns: auto minmax(0, 2fr) minmax(240px, 1fr);
  gap: 28px;
  padding: 28px;
  align-items: start;
}
.columns > * { min-width: 0; }

/* 왼쪽 칸: 게임 자리
   컴퓨터 화면에서는 창 높이에 맞춰 줄어들어 스크롤 없이 전체가 보인다 */
#game-slot {
  position: relative;
  height: clamp(380px, calc(100vh - 200px), 640px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: linear-gradient(#6aa7dc 0%, #8fd3ec 55%, #a9ecf0 100%);
  border: 5px solid var(--pink-soft);
  box-shadow: 0 0 0 3px var(--berry);
}
.sky-band { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: #5b98d2; }
.sky-wave {
  position: absolute;
  top: 36px;
  left: -10%;
  width: 120%;
  height: 48px;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, #5b98d2 98%, transparent 100%) 0 0 / calc(100% / 6) 100% repeat-x;
}
.platform {
  position: absolute;
  height: 22px;
  border-radius: 6px 6px 14px 14px;
  background: #6b4a3a;
  border-top: 8px solid #5fae3a;
}
.p1 { top: 22%; right: 6%; width: 34%; }
.p2 { top: 36%; left: 8%; width: 28%; height: 20px; }
.p3 { top: 58%; left: -4%; width: 42%; border-radius: 0 6px 14px 14px; }
.p4 { top: 68%; right: -4%; width: 30%; border-radius: 6px 0 14px 14px; }
/* 주인공: 삼색 고양이 (흰 바탕 + 주황, 검정 무늬)
   왼쪽 위 두 번째 발판(.p2) 위에 앉아 있다 */
.cat {
  --cat-white: #fffaf5;
  --cat-orange: #f08a2c;
  --cat-black: #2b2230;
  --cat-line: #3a2230;
  --cat-pink: #f7a1b8;
  position: absolute;
  left: calc(22% - 32px);
  top: calc(36% - 54px);
  width: 64px;
  height: 56px;
}
.cat > span,
.cat-head > span { position: absolute; display: block; }

/* 꼬리: 주황과 검정 줄무늬가 있는 둥근 꼬리 */
.cat-tail {
  right: -14px;
  bottom: 2px;
  width: 30px;
  height: 30px;
  border: 6px solid transparent;
  border-right-color: var(--cat-orange);
  border-bottom-color: var(--cat-black);
  border-radius: 50%;
  transform: rotate(-20deg);
}

/* 몸통: 먼치킨처럼 낮고 긴 하얀 몸 */
.cat-body {
  left: 6px;
  bottom: 3px;
  width: 52px;
  height: 22px;
  border: 2px solid var(--cat-line);
  border-radius: 45% 45% 40% 40% / 60% 60% 40% 40%;
  background: var(--cat-white);
}

/* 다리: 먼치킨처럼 짧고 통통한 앞다리 두 개 */
.cat-paw {
  bottom: -1px;
  width: 10px;
  height: 7px;
  border: 2px solid var(--cat-line);
  border-radius: 30% 30% 50% 50%;
  background: var(--cat-white);
}
.cat-paw-l { left: 18px; }
.cat-paw-r { left: 32px; }

/* 귀: 왼쪽은 주황, 오른쪽은 검정. 안쪽은 분홍 */
.cat-ear {
  top: 0;
  width: 18px;
  height: 18px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.cat-ear::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 7px;
  width: 8px;
  height: 9px;
  background: var(--cat-pink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.cat-ear-l { left: 9px; background: var(--cat-orange); transform: rotate(-12deg); }
.cat-ear-r { right: 9px; background: var(--cat-black); transform: rotate(12deg); }

/* 머리: 왼쪽 위 주황 무늬, 오른쪽 위 검은 무늬 */
.cat-head {
  left: 6px;
  top: 7px;
  width: 52px;
  height: 38px;
  border: 2px solid var(--cat-line);
  border-radius: 50% / 54% 54% 46% 46%;
  background:
    radial-gradient(ellipse 42% 46% at 14% 18%, var(--cat-orange) 98%, transparent 100%),
    radial-gradient(ellipse 34% 40% at 88% 14%, var(--cat-black) 98%, transparent 100%),
    var(--cat-white);
}

/* 표정: 활짝 웃는 얼굴 */

/* 눈: 웃을 때 감기는 ^ ^ 모양 */
.cat-eye {
  top: 13px;
  width: 10px;
  height: 6px;
  border: 2.5px solid var(--cat-line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.cat-eye-l { left: 10px; }
.cat-eye-r { right: 10px; }

/* 볼: 웃어서 발그레한 볼 */
.cat-cheek {
  top: 20px;
  width: 9px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat-pink);
  opacity: .9;
}
.cat-cheek-l { left: 4px; }
.cat-cheek-r { right: 4px; }

/* 코 */
.cat-nose {
  left: calc(50% - 3px);
  top: 18px;
  width: 6px;
  height: 4px;
  border-radius: 50% 50% 60% 60%;
  background: var(--cat-pink);
}

/* 입: 다문 채로 웃는 ω 모양 */
.cat-mouth {
  left: calc(50% - 6px);
  top: 21px;
  width: 12px;
  height: 5px;
}
.cat-mouth::before,
.cat-mouth::after {
  content: "";
  position: absolute;
  top: 0;
  width: 6px;
  height: 5px;
  border: 1.8px solid var(--cat-line);
  border-top: 0;
  border-radius: 0 0 50% 50%;
}
.cat-mouth::before { left: 0; }
.cat-mouth::after { right: 0; }

/* 수염: 양쪽에 두 가닥씩 */
.cat-whisker {
  top: 19px;
  width: 13px;
  height: 1.5px;
  background: var(--cat-line);
  box-shadow: 0 4px 0 var(--cat-line);
}
.cat-whisker-l { left: -9px; transform: rotate(8deg); }
.cat-whisker-r { right: -9px; transform: rotate(-8deg); }
.ground {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 9%;
  background: #6b4a3a;
  border-top: 12px solid #5fae3a;
}
.slot-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}
.slot-label {
  background: rgba(255, 250, 251, 0.92);
  border: 3px dashed var(--berry);
  padding: 14px 18px;
  font-weight: 800;
  font-size: 17px;
  color: var(--berry);
}

/* 가운데 칸: 게임 소개 */
#game-about {
  display: flex;
  flex-direction: column;
  gap: 18px;
  line-height: 1.7;
  font-size: 16px;
}
#game-about h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}
#game-about p { margin: 0; }
#game-about .mood { margin-top: 8px; font-style: italic; color: var(--berry-mid); }
#game-about hr { width: 100%; margin: 0; border: 0; border-top: 3px dotted var(--pink); }

.keys { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 3px solid var(--berry);
  box-shadow: 0 3px 0 var(--berry);
  font-weight: 800;
}
.key-text { font-weight: 700; }

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 20px;
}
.facts dt { font-weight: 800; }
.facts dd { margin: 0; }
.facts .creator { color: var(--green); font-weight: 700; }

/* 오른쪽 칸: 점수 */
.col-score { display: flex; flex-direction: column; gap: 14px; }
.score-title { margin: 0; font-weight: 900; font-size: 28px; color: var(--berry); }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 800;
  font-size: 14px;
}
.field input {
  font: inherit;
  font-weight: 400;
  font-size: 16px;
  width: 100%;
  min-width: 0;
  color: var(--berry);
  padding: 10px 12px;
  min-height: 44px;
  border: 3px solid var(--berry);
  background: #fff;
  outline: none;
}
.field input:focus { border-color: var(--green); }

/* 버튼: 점수 올리기, 댓글 올리기, 관리자 버튼이 같은 모양을 쓴다 */
#score-submit,
#comment-submit,
#admin-load,
.admin-buttons button {
  font: inherit;
  font-weight: 800;
  font-size: 16px;
  color: var(--page-bg);
  background: var(--lime);
  border: 3px solid var(--page-bg);
  min-height: 48px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--page-bg);
}
#score-submit:hover, #comment-submit:hover, #admin-load:hover, .admin-buttons button:hover { background: var(--lime-light); }
#score-submit:active, #comment-submit:active, #admin-load:active, .admin-buttons button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--page-bg); }
#score-submit:focus-visible, #comment-submit:focus-visible, #admin-load:focus-visible, .admin-buttons button:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
/* 잠긴 버튼: 여러 번 눌러도 한 번만 올라가게 */
#score-submit:disabled, #comment-submit:disabled, .admin-buttons button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--page-bg); }
.field input[readonly] { background: #f6eef2; }

/* 안내 문구 */
#score-message, #comment-message, #admin-message { margin: 0; min-height: 1.4em; font-weight: 800; font-size: 14px; }
#score-message.ok, #comment-message.ok, #admin-message.ok { color: var(--green); }
#score-message.error, #comment-message.error, #admin-message.error { color: var(--pink); }

#scoreboard {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  background: var(--page-bg);
  color: #fff;
  border: 3px solid var(--berry);
}
#scoreboard li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 2px dotted #6a3a6f;
}
#scoreboard li:last-child { border-bottom: 0; }
#scoreboard .rank {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink);
  font-weight: 800;
  font-size: 14px;
}
#scoreboard .name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scoreboard .points { flex: none; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; }
/* 방금 올린 내 점수 강조 */
#scoreboard li.mine { background: var(--berry); outline: 3px solid var(--lime); outline-offset: -3px; }
#scoreboard li.mine .name::after { content: " (나)"; color: var(--lime); }
/* 점수판 아래 안내 */
.score-notice { margin: 0; font-size: 12px; color: var(--berry-mid); }

/* 맨 아래: 댓글 (세 칸과 같은 좌우 여백) */
#game-comments {
  margin: 0 28px 28px;
  padding-top: 24px;
  border-top: 3px dotted var(--pink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.comments-title { margin: 0; font-weight: 900; font-size: 28px; color: var(--berry); }
.comment-form { display: flex; flex-direction: column; gap: 14px; }
.field textarea {
  font: inherit;
  font-weight: 400;
  font-size: 16px;
  width: 100%;
  min-width: 0;
  color: var(--berry);
  padding: 10px 12px;
  border: 3px solid var(--berry);
  background: #fff;
  outline: none;
  resize: vertical;
}
.field textarea:focus { border-color: var(--green); }
.field textarea::placeholder { color: var(--placeholder); }
#comment-list, #admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment, .comment-empty, .admin-item {
  padding: 12px 14px;
  border: 3px solid var(--berry);
  background: #fff;
}
.comment-name { display: block; font-weight: 800; }
.comment-body { margin: 4px 0 0; line-height: 1.6; white-space: pre-wrap; }
.comment.pending, .comment-empty { color: var(--berry-mid); font-style: italic; border-style: dashed; }

/* 관리자 페이지 */
.admin { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.admin-login { display: flex; flex-direction: column; gap: 14px; max-width: 360px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.admin-status { font-size: 13px; font-weight: 800; color: var(--pink); }
.admin-status.visible { color: var(--green); }
.admin-time { font-size: 13px; color: var(--berry-mid); }
.admin-buttons { display: flex; gap: 10px; margin-top: 10px; }
.admin-buttons button { min-height: 40px; padding: 0 16px; font-size: 15px; }
.admin-buttons button.danger { background: var(--pink-soft); }

/* 태블릿: 게임과 소개를 위에, 점수를 아래에 */
@media (max-width: 1000px) {
  .columns { grid-template-columns: auto minmax(0, 1fr); }
  .col-score { grid-column: 1 / -1; }
}

/* 휴대폰: 배너 → 게임 → 소개 → 점수 순서로 쌓는다 */
@media (max-width: 700px) {
  .page { padding: 12px 10px 32px; }
  #game-banner { padding: 18px 20px; }
  .columns { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; gap: 24px; }
  .col-score { grid-column: auto; }
  #game-comments { margin: 0 16px 20px; }
  .admin { padding: 20px 16px; }
  #game-slot {
    height: auto;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }
}
