@charset "UTF-8";

/* 시안에서 가져온 색 */
:root {
  --ground: #bfe0ef;
  --panel: #f4fafd;
  --panel-soft: rgba(244, 250, 253, 0.94);
  --slot: #e6f3f9;
  --line: #c4dde9;
  --line-strong: #a9c6d6;
  --text: #1f3a4d;
  --text-strong: #16324a;
  --text-soft: #2c4a5e;
  --text-dim: #557489;
  --blue: #0074b0;
  --blue-light: #1a8fcc;
  --green: #7cc36b;
  --green-dark: #3f8a2e;
  --font-title: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-body: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  /* 컴퓨터 화면의 게임 자리 높이를 계산할 때 쓰는 값 */
  --page-top: 24px;
  --page-bottom: 24px;
  --gap: 20px;
  --banner-height: 104px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--ground);
}

body {
  font-family: var(--font-body);
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
}

h2 {
  font-size: 26px;
  color: var(--text-strong);
}

p {
  margin: 0;
}

/* 배경 */
.page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--ground);
}

.deco {
  position: absolute;
  pointer-events: none;
}

.deco-frame {
  left: -60px;
  top: 120px;
  width: 220px;
  height: 220px;
  border: 18px solid rgba(255, 255, 255, 0.6);
  transform: rotate(12deg);
}

.deco-block {
  right: -80px;
  top: 420px;
  width: 260px;
  height: 120px;
  background: rgba(0, 116, 176, 0.14);
  transform: rotate(-8deg);
}

.deco-line {
  left: 4%;
  bottom: 80px;
  width: 140px;
  height: 14px;
  background: rgba(124, 195, 107, 0.7);
}

.wrap {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--page-top) 16px var(--page-bottom);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 배너 */
#game-banner {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding: 18px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
}

#game-banner h1 {
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--blue);
}

#game-banner h1::before {
  content: "🐱 ";
}

#game-banner h1::after {
  content: " 🐾";
}

#game-banner p {
  padding-right: 72px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-soft);
}

#game-banner p::after {
  content: " 😺";
}

.banner-dots {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
  font-size: 22px;
}

.banner-dots span:nth-child(1)::before {
  content: "🐈";
}

.banner-dots span:nth-child(2)::before {
  content: "🐾";
}

.banner-dots span:nth-child(3) {
  display: none;
}

/* 세 칸: 휴대폰에서는 위에서 아래로 쌓는다 */
.columns {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 게임 자리 */
#game-slot {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 9 / 16;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background-color: var(--slot);
  border: 3px solid var(--blue);
}

#game-slot::before,
#game-slot::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  background: var(--blue);
}

#game-slot::before {
  left: 0;
}

#game-slot::after {
  right: 0;
}

#game-slot p {
  position: relative;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  text-align: center;
}

#game-slot p::before {
  content: "😺 ";
}

.block {
  position: absolute;
}

.block-yellow {
  left: 30%;
  bottom: 16%;
  width: 22px;
  height: 22px;
  background: var(--green);
}

.block-pink {
  left: 52%;
  bottom: 26%;
  width: 56px;
  height: 10px;
  background: var(--blue);
}

.block-blue {
  left: 24%;
  bottom: 36%;
  width: 56px;
  height: 10px;
  background: var(--blue);
}

/* 가운데 칸과 오른쪽 칸 */
.panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

#game-about {
  gap: 22px;
}

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

.about-group:nth-child(1) h2::before {
  content: "😸 ";
}

.about-group:nth-child(3) h2::before {
  content: "🙀 ";
}

.about-group p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-soft);
}

.dots {
  display: flex;
  gap: 8px;
  font-size: 16px;
}

.dots span::before {
  content: "🐾";
}

.keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-soft);
}

.keys span:last-child::after {
  content: " 🐈";
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border: 2px solid var(--blue);
  color: var(--blue);
}

.info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.info div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--panel);
}

.info dt {
  font-size: 12px;
  color: var(--text-dim);
}

.info div:nth-child(1) dt::before {
  content: "🐱 ";
}

.info div:nth-child(2) dt::before {
  content: "🕹️ ";
}

.info div:nth-child(3) dt::before {
  content: "🌐 ";
}

.info div:nth-child(4) dt::before {
  content: "🛠️ ";
}

.info dd {
  margin: 0;
  font-size: 15px;
}

.info .maker {
  color: var(--blue);
}

.score-panel {
  gap: 16px;
}

#scoreboard-title::before {
  content: "😻 ";
}

.score-panel label,
#game-comments label,
.admin-panel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
}

.score-panel input,
#game-comments input,
#game-comments textarea,
.admin-panel input {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-strong);
  background: #fff;
  border: 1px solid var(--line-strong);
}

.score-panel input::placeholder,
#game-comments input::placeholder,
#game-comments textarea::placeholder,
.admin-panel input::placeholder {
  color: #7f9aab;
}

.score-panel input:focus,
#game-comments input:focus,
#game-comments textarea:focus,
.admin-panel input:focus,
#score-submit:focus-visible,
#comment-submit:focus-visible,
.admin-panel button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

#score-submit,
#comment-submit,
.admin-panel button {
  min-height: 48px;
  padding: 12px;
  font-family: inherit;
  font-size: 16px;
  color: #fff;
  background: var(--blue);
  border: none;
  cursor: pointer;
}

#score-submit::before {
  content: "🐾 ";
}

#score-submit:hover,
#comment-submit:hover,
.admin-panel button:hover {
  background: var(--blue-light);
}

#scoreboard {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

#scoreboard li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

/* 순위 숫자 대신 고양이 그림을 보여 준다 */
#scoreboard .rank {
  flex: none;
  width: 28px;
  font-size: 0;
}

#scoreboard .rank::before {
  font-size: 20px;
}

#scoreboard li:nth-child(1) .rank::before {
  content: "😻";
}

#scoreboard li:nth-child(2) .rank::before {
  content: "😸";
}

#scoreboard li:nth-child(3) .rank::before {
  content: "😺";
}

#scoreboard .name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
}

#scoreboard .points {
  flex: none;
  font-size: 15px;
  color: var(--blue);
}

.score-notice {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* 댓글 */
#game-comments {
  gap: 16px;
}

#comments-title::before {
  content: "💬 ";
}

#game-comments textarea {
  resize: vertical;
}

#comment-list,
.admin-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

#comment-list li,
.admin-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.comment-name {
  color: var(--blue);
}

.comment-body {
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.comment-pending {
  font-size: 14px;
  color: var(--text-dim);
}

/* 관리자 페이지 */
.admin-panel {
  gap: 16px;
}

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

.admin-actions button {
  min-height: 40px;
  padding: 8px 14px;
}

.admin-panel button:disabled,
#comment-submit:disabled,
#score-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* 좁은 화면: 제목이 겹치거나 줄이 밀리지 않게 배너 장식을 숨긴다 */
@media (max-width: 599px) {
  .banner-dots {
    display: none;
  }

  #game-banner h1::after {
    content: none;
  }

  #game-banner p {
    padding-right: 0;
  }
}

/* 컴퓨터 화면: 세 칸을 나란히 놓고, 게임 자리 높이를 화면 높이에 맞춘다 */
@media (min-width: 1000px) {
  #game-banner {
    height: var(--banner-height);
    align-content: center;
  }

  .columns {
    flex-direction: row;
    align-items: flex-start;
  }

  #game-slot {
    flex: none;
    width: auto;
    max-width: none;
    margin: 0;
    height: min(
      675px,
      calc(100vh - var(--page-top) - var(--page-bottom) - var(--banner-height) - var(--gap))
    );
  }

  #game-about {
    flex: 1.4 1 0;
  }

  .score-panel {
    flex: 1 1 0;
  }
}
