/* 하니네 마루 (쉼터): 달밤의 한옥 마루 */

body.maru-page {
  background: #17203d;
  color: #f4efe4;
}
.maru-page .site-head {
  background: rgba(23, 32, 61, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
.maru-page .logo {
  color: #fff;
}
.maru-page .site-nav a {
  color: rgba(255, 255, 255, 0.78);
}
.maru-page .site-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* 무대 */
.maru-stage {
  overflow: hidden;
  background: #131a36;
}
.maru-stage-inner {
  --w: max(100%, 780px);
  position: relative;
  width: var(--w);
  aspect-ratio: 1200 / 520;
  max-height: 520px;
  margin-left: calc((100% - var(--w)) * 0.74);
  margin-inline-end: auto;
}
@media (min-width: 1200px) {
  .maru-stage-inner {
    width: 1200px;
    margin-inline: auto;
  }
}
.maru-scene,
.maru-scene svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.maru-cat {
  position: absolute;
  left: 61.8%;
  top: 56.9%;
  width: 11.7%;
  transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1);
  transform-origin: 50% 100%;
}
.maru-cat.is-jump {
  transform: translateY(-9%) scale(1.05);
}
.maru-bubble {
  position: absolute;
  right: 40%;
  top: 43%;
  max-width: 30%;
  padding: 0.7em 1em;
  border-radius: 1.1em 1.1em 0.3em 1.1em;
  background: #fffdf8;
  color: var(--ink);
  font-size: clamp(13px, 1.5vw, 17px);
  font-weight: 700;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  animation: bubble-in 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
@keyframes bubble-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}

/* 놀이 */
.maru-play {
  padding: 36px 0 20px;
  background: linear-gradient(#8a6244 0, #6f4d36 120px, #5b3f2d 100%);
  border-top: 6px solid #ddb07e;
}
.maru-title {
  font-size: clamp(26px, 4vw, 36px);
  color: #fff;
}
.maru-lead {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
}
.maru-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.maru-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px 14px;
  border-radius: 18px;
  background: #b3302a;
  border: 2px solid #7f1f1b;
  box-shadow: 0 5px 0 #7f1f1b, inset 0 0 0 4px rgba(255, 216, 138, 0.35);
  color: #fff;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}
.maru-tab:hover {
  background: #c23a33;
}
.maru-tab[aria-selected='true'] {
  background: #ffd98a;
  border-color: #c98f2b;
  box-shadow: 0 2px 0 #c98f2b, inset 0 0 0 4px rgba(255, 255, 255, 0.5);
  color: #5a3a06;
  transform: translateY(3px);
}
.maru-tab b {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 22px);
}
.maru-tab span {
  font-size: 13px;
  opacity: 0.85;
}
.maru-tab i {
  font-style: normal;
  font-size: 28px;
  line-height: 1.1;
}
.maru-panel {
  margin-top: 18px;
  padding: 24px;
  border-radius: 22px;
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  min-height: 300px;
}
.maru-panel h2 {
  font-family: var(--font-display);
  font-size: 24px;
}
.maru-panel .rule {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
}
.maru-foot {
  margin-top: 0;
  background: #5b3f2d;
  border-top-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.6);
}

.g-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.g-input {
  flex: 1 1 200px;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border-radius: 14px;
  border: 2px solid var(--line-2);
  background: #fff;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.g-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.g-status {
  margin-top: 14px;
  min-height: 1.7em;
  font-weight: 700;
  color: var(--ink-2);
}
.g-status.is-good {
  color: var(--mint-deep);
}
.g-status.is-bad {
  color: var(--coral-deep);
}
.g-score {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--amber-soft);
  color: #7a4f08;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* 끝말잇기 */
.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 4px;
  margin-top: 18px;
  padding: 16px;
  min-height: 86px;
  border-radius: 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
}
.chain-word {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 12px 7px;
  border-radius: 14px;
  background: var(--coral-soft);
  border: 1.5px solid var(--coral);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.25;
  animation: bubble-in 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.chain-word small {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--coral-deep);
}
.chain-word.is-me {
  background: var(--blue-soft);
  border-color: var(--blue);
}
.chain-word.is-me small {
  color: var(--blue-deep);
}
.chain-word u {
  text-decoration: none;
  color: var(--coral-deep);
}
.chain-arrow {
  color: var(--ink-3);
  font-weight: 700;
}
.chain-next {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px dashed var(--blue);
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--blue-deep);
}

/* 초성 퀴즈 */
.cho-card {
  margin-top: 18px;
  padding: 22px 16px;
  display: grid;
  justify-items: center;
  gap: 12px;
  border-radius: 18px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  text-align: center;
}
.cho-letters {
  font-size: clamp(34px, 7vw, 50px);
}
.cho-letters .cell {
  background: #fff;
}
.cho-hint {
  font-size: 17px;
  color: var(--ink-2);
}
.cho-pic {
  font-size: 60px;
  line-height: 1.1;
  min-height: 66px;
}
.cho-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.cho-choice {
  min-height: 56px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  box-shadow: 0 3px 0 var(--line-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cho-choice:active {
  transform: translateY(3px);
  box-shadow: none;
}
.cho-choice.is-right {
  background: var(--mint-soft);
  border-color: var(--mint);
  box-shadow: 0 3px 0 var(--mint);
  color: var(--mint-deep);
}
.cho-choice.is-wrong {
  background: var(--coral-soft);
  border-color: var(--coral);
  box-shadow: 0 3px 0 var(--coral);
  color: var(--coral-deep);
  animation: wg-shake 0.4s;
}
@keyframes wg-shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}

/* 삼행시 */
.poem-form {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}
.poem-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.poem-line .cell {
  flex: none;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--grid);
  background: var(--coral-soft);
  color: var(--coral-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  border-radius: 10px;
}
.poem-line .g-input {
  height: 50px;
  font-size: 19px;
}
.poem-example {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--blue-soft);
  font-size: 15px;
  line-height: 1.8;
}
.poem-example b {
  color: var(--blue-deep);
}
.line-wrap {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 2px dashed var(--line);
}
.line-wrap h3 {
  font-family: var(--font-display);
  font-size: 19px;
}
.clothesline {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 14px;
  margin-top: 18px;
  padding-top: 14px;
  background: linear-gradient(#b9a98f, #b9a98f) 0 6px / 100% 2.5px no-repeat;
}
.note {
  position: relative;
  width: 168px;
  padding: 16px 14px 14px;
  border-radius: 4px;
  background: #fffdf5;
  box-shadow: 0 6px 14px rgba(74, 51, 41, 0.16);
  font-size: 14.5px;
  line-height: 1.75;
  transform: rotate(var(--r, -2deg));
  transform-origin: 50% 0;
}
.note:nth-child(3n + 2) {
  --r: 1.6deg;
  background: #fde8e5;
}
.note:nth-child(3n) {
  --r: -1deg;
  background: #e9f1fd;
}
.note::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -12px;
  width: 12px;
  height: 22px;
  margin-left: -6px;
  border-radius: 3px;
  background: var(--coral);
}
.note b {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--coral-deep);
}
.note time {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.note button {
  position: absolute;
  right: 4px;
  top: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--ink-3);
  font-size: 16px;
}
.note button:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
}
.line-empty {
  color: var(--ink-3);
  font-size: 14.5px;
}

@media (max-width: 640px) {
  .maru-tabs {
    gap: 8px;
  }
  .maru-tab {
    padding: 12px 6px 10px;
  }
  .maru-tab span {
    display: none;
  }
  .maru-panel {
    padding: 18px 14px;
  }
  .maru-bubble {
    right: 42%;
    top: 30%;
    max-width: 34%;
  }
  .note {
    width: calc(50% - 7px);
  }
}
