@import url("https://fonts.googleapis.com/css2?family=Germania+One&display=swap");

:root {
  --bg: #101218;
  --page-bg: #2c210d;
  --page-gradient:
    radial-gradient(circle at 14% 6%, rgba(242, 191, 91, 0.12), transparent 33%),
    radial-gradient(circle at 86% 14%, rgba(255, 255, 255, 0.05), transparent 30%),
    linear-gradient(166deg, #312d28, #2c210d 54%, #35250b);
  --card: #1b202b;
  --card-soft: #242b38;
  --text: #f7f2e9;
  --muted: #bdb5aa;
  --accent: #f2bf5b;
  --accent-2: #ffe1a1;
  --ok: #98e8aa;
  --danger: #ff7d7d;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --focus-inner-paper: rgba(255, 239, 226, 0.98);
  --focus-edge-paper: #ff4902f2;
  --focus-shadow-ring:
    inset 0 0 0 0px var(--focus-inner-paper),
    inset 0px 0px 10px 8px var(--focus-edge-paper),
    inset 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px rgba(0, 0, 0, 0.14);
  --focus-shadow-card:
    inset 0 0 0 0px var(--focus-inner-paper),
    inset 0px 0px 25px 8px var(--focus-edge-paper),
    inset 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px rgba(0, 0, 0, 0.14);
  --paper-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='table' tableValues='0 0.15 0.38 0.72 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.85'/%3E%3C/svg%3E");
  --paper-fiber: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.045 0.72' numOctaves='2' seed='13' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23f)' opacity='0.3'/%3E%3C/svg%3E");
  --paper-fiber-lines: url("assets/paper-pulp-reference.png");
  --paper-surface-size: 520px auto, auto;
  --paper-surface-repeat: repeat, no-repeat;
  --paper-surface-blend: multiply, normal;
  --paper-grad-warm: linear-gradient(0deg, #f9edd1 0%, #efd9ad 42%, #e1c188 100%);
  --paper-grad-light: linear-gradient(180deg, #f9edd1 0%, #efd9ad 36%, #e3c58d 100%);
  --app-max-width: 920px;
  --app-shell-padding: 24px;
  --viewport-height: 100dvh;
  --intro-mobile-image-height: 248px;
  --intro-mobile-bottom-space: 208px;
  --onboarding-mobile-footer-space: 136px;
  --onboarding-mobile-figure-height: 520px;
  --onboarding-mobile-overlay-bottom: 34px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  min-height: 100%;
  background-color: var(--page-bg);
  background-image: var(--page-gradient);
  background-repeat: no-repeat;
  background-size: cover;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--page-bg);
  background-image: var(--page-gradient);
  background-repeat: no-repeat;
  background-size: cover;
  font-family: Georgia, serif;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.56;
}

body.intro-active,
body.onboarding-active {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.36;
  background:
    repeating-linear-gradient(
      78deg,
      rgba(255, 255, 255, 0.032) 0 1px,
      rgba(255, 255, 255, 0) 1px 7px
    ),
    repeating-linear-gradient(
      102deg,
      rgba(0, 0, 0, 0.2) 0 1px,
      rgba(0, 0, 0, 0) 1px 8px
    ),
    linear-gradient(180deg, rgba(11, 13, 20, 0.22), rgba(11, 13, 20, 0.08));
  mix-blend-mode: soft-light;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% -8%, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 50% 120%, rgba(0, 0, 0, 0.34), transparent 50%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(var(--app-max-width), 100%);
  margin: 0 auto;
  padding: calc(var(--app-shell-padding) + env(safe-area-inset-top, 0px)) var(--app-shell-padding) var(--app-shell-padding);
}

body.intro-active .app,
body.onboarding-active .app {
  width: min(1120px, 100%);
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.welcome-screen {
  width: 100%;
  min-height: calc(100vh - (var(--app-shell-padding) * 2));
  display: grid;
  align-items: center;
}

.intro-layout {
  display: grid;
  gap: 24px;
  align-items: center;
}

.paper-frame {
  --paper-frame-edge: polygon(
    1.1% 1.9%, 6.3% 1.2%, 14.8% 1.6%, 25.8% 1.1%, 37.7% 1.5%, 49.6% 1%, 61.7% 1.6%, 73.9% 1.1%,
    85.4% 1.6%, 93.8% 1.2%, 98.9% 1.9%,
    98.6% 14.8%, 99% 28.7%, 98.4% 42.7%, 98.9% 56.6%, 98.3% 70.4%, 98.8% 84.5%, 97.8% 97.8%,
    90.8% 97.1%, 81.9% 98%, 70.8% 97.2%, 58.6% 98.1%, 46.4% 97.2%, 34.3% 98%, 22.6% 97.1%,
    11.5% 97.8%, 2.1% 97.1%, 1.4% 83.4%, 1.9% 69.9%, 1.2% 55.9%, 1.8% 42.1%, 1.3% 28.2%, 1.7% 14.3%
  );
  position: relative;
  margin-top: 0;
  padding: 0;
  overflow: hidden;
  clip-path: var(--paper-frame-edge);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.22);
}

.paper-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: var(--paper-frame-edge);
  pointer-events: none;
  background: var(--paper-fiber-lines);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  mix-blend-mode: multiply;
  opacity: 0.08;
}

.paper-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  clip-path: var(--paper-frame-edge);
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(132, 95, 44, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(132, 95, 44, 0.08);
}

.intro-illustration-card,
.onboarding-paper {
  margin-top: 0;
}

.intro-illustration-card {
  min-height: clamp(360px, 58vh, 760px);
}

.intro-copy {
  display: grid;
  align-content: center;
  gap: 10px;
  max-width: 420px;
}

.intro-title {
  margin-bottom: 0;
}

.intro-subtitle {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

.intro-actions {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.intro-primary,
.intro-secondary,
.onboarding-cta {
  width: 100%;
}

.onboarding-shell {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: calc(100vh - (var(--app-shell-padding) * 2));
}

.onboarding-paper {
  position: relative;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  clip-path: none;
  isolation: isolate;
}

.onboarding-skip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
}

.onboarding-figure,
.onboarding-art-picture {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.onboarding-figure {
  min-height: clamp(480px, 72vh, 840px);
  border-radius: 0;
}

.onboarding-art-picture {
  position: absolute;
  inset: 0;
}

.onboarding-art-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.98) contrast(1.02);
}

.onboarding-overlay {
  position: absolute;
  left: clamp(12px, 2vw, 22px);
  right: clamp(12px, 2vw, 22px);
  bottom: clamp(18px, 2.8vw, 30px);
  padding: 20px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 243, 216, 0.95), rgba(229, 205, 156, 0.94));
  color: #2d2112;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.24),
    inset 0 1px rgba(255, 255, 255, 0.54);
  clip-path: polygon(
    1.1% 5.4%, 5.4% 4.4%, 12.9% 4%, 21.9% 4.6%, 31.4% 4.1%, 41.5% 4.7%, 51.1% 4.1%, 61.5% 4.8%,
    71.8% 4.1%, 81.3% 4.7%, 89.9% 4.2%, 95.2% 4.9%, 98.7% 5.6%,
    98.9% 18.2%, 98.4% 31.5%, 98.9% 44.9%, 98.4% 58.1%, 98.8% 71.3%, 98.3% 84.4%, 97.6% 93.5%,
    92.5% 94.3%, 84.4% 93.8%, 74.2% 94.5%, 62.4% 94%, 50.1% 94.7%, 38.1% 94.1%, 26.2% 94.6%, 15.2% 93.9%,
    6.1% 94.3%, 1.4% 93.2%, 1.1% 84.1%, 1.6% 71.1%, 1.2% 58%, 1.7% 44.8%, 1.1% 31.5%, 1.6% 18.3%
  );
}

.onboarding-overlay h2 {
  color: #342313;
  font-size: clamp(1.35rem, 4.4vw, 2.05rem);
  line-height: 0.98;
  margin-bottom: 8px;
}

.onboarding-overlay p:last-child {
  margin-bottom: 0;
  color: #4a3520;
}

.onboarding-footer {
  width: min(100%, 1080px);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.onboarding-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.onboarding-dot {
  width: 12px;
  height: 12px;
  padding: 0;
  border-radius: 999px;
  clip-path: none;
  border: 1px solid rgba(255, 241, 211, 0.36);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.onboarding-dot.active {
  background: var(--accent);
  border-color: rgba(116, 78, 26, 0.44);
  transform: scale(1.08);
}

#onboardingTouchSurface {
  touch-action: pan-y;
}

.hero {
  display: block;
  margin-bottom: 36px;
  transition: margin 420ms ease;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0;
}

.app-mark {
  width: auto;
  height: clamp(82px, 12vw, 118px);
  max-width: min(220px, 70vw);
  object-fit: contain;
  margin: 0 0 18px;
  filter:drop-shadow(0px -20px 32px rgba(242, 191, 91, 0.8)) ;
  transform-origin: center top;
  transition:
    opacity 420ms ease,
    transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
    height 420ms ease,
    margin 420ms ease;
}

.is-playing .hero {
  margin-top: 8px;
  margin-bottom: 18px;
}

.is-playing .app-mark {
  display: none;
}

.is-playing .brand-lockup {
  justify-items: start;
  text-align: left;
  padding-right: 0;
}

.is-playing h1 {
  font-size: clamp(2rem, 8vw, 3rem);
  margin-bottom: 4px;
}

.is-playing .hero .eyebrow {
  font-size: 0.66rem;
}

.entry-compact .hero {
  margin-bottom: 18px;
}

.entry-compact .app-mark {
  height: 0;
  margin-bottom: 0;
  opacity: 0;
  transform: translateY(-12px) scale(0.78);
  pointer-events: none;
}

.entry-compact h1 {
  font-size: clamp(2.5rem, 9vw, 4.2rem);
  margin-bottom: 8px;
}

.entry-compact #entryScreen {
  transform: translateY(-4px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong,
label,
button,
.eyebrow,
.tab,
.player-chip,
.definition-card strong,
.dictionary-card strong,
.revealed-card .meta,
.score-row strong {
  font-family: Georgia, serif;
  font-weight: 600;
  font-style: italic;
}

h1 {
  font-family: "Germania One", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.7rem, 8vw, 5.6rem);
  line-height: 0.94;
  margin-bottom: 12px;
  letter-spacing: 0;
  transition: font-size 420ms cubic-bezier(0.22, 1, 0.36, 1), margin 420ms ease;
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.05;
  margin-bottom: 10px;
  letter-spacing: 0.028em;
}

#votingView .eyebrow {
  margin-bottom: 18px;
}

h3 {
  margin: 24px 0 12px;
  font-size: 1.18rem;
  letter-spacing: 0.026em;
}

p {
  letter-spacing: 0.022em;
  line-height: 1.62;
  font-size: 1rem;
}

.subtitle,
.muted {
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.022em;
  line-height: 1.64;
}

.subtitle {
  max-width: 620px;
  margin-top: 30px;
  margin-bottom: 0;
  font-size: 1.06rem;
}

.game-context-bar {
  width: 100%;
  display: grid;
  justify-items: stretch;
  gap: 14px;
  margin-top: 18px;
}

.helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.word-search-helper {
  margin: 2px 0 8px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
}

.brand-lockup > .eyebrow {
  text-transform: none;
  letter-spacing: 0.1em;
  font-size: 1rem;
  font-weight: 400;
}

.card,
.notice {
  background: rgba(27, 32, 43, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 24px;
  backdrop-filter: blur(12px);
}

.notice {
  margin-bottom: 16px;
}

#entryScreen {
  display: grid;
  justify-items: center;
  padding: 8px;
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

#gameScreen {
  padding: 8px;
  --fixed-cta-side-gap: 32px;
  --fixed-cta-max-width: 856px;
  --fixed-cta-bottom-offset: 12px;
  --fixed-cta-strip-height: 72px;
}

.phase-view {
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

.notice.soft {
  background: rgba(242, 191, 91, 0.11);
  border-color: rgba(242, 191, 91, 0.32);
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.avatar {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(242, 191, 91, 0.35);
  background:
    radial-gradient(circle at 30% 25%, rgba(242, 191, 91, 0.28), transparent 35%),
    rgba(36, 43, 56, 0.86);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 44px;
  height: 44px;
  font-size: 0.9rem;
}

.avatar-preview {
  width: 64px;
  height: 64px;
  font-size: 1.05rem;
}

.avatar-player {
  width: 38px;
  height: 38px;
  font-size: 0.78rem;
}

.avatar-empty {
  background:
    radial-gradient(circle at 32% 26%, rgba(242, 191, 91, 0.18), transparent 30%),
    linear-gradient(180deg, #394150, #222834 68%, #181d25);
  border-color: rgba(242, 191, 91, 0.28);
  color: #f1d28c;
  font-family: "Germania One", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: 2em;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  line-height: 1em;
}

.avatar-upload {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.avatar-library-btn {
  width: fit-content;
}

.pre-game-options {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(242, 191, 91, 0.24);
  border-radius: 16px;
  background: rgba(4, 3, 1, 0.34);
}

.pre-game-options h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  min-width: 84px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  background: rgba(4, 3, 1, 0.6);
  color: var(--muted);
}

.pill.selected {
  background: rgba(242, 191, 91, 0.2);
  border-color: rgba(242, 191, 91, 0.56);
  color: var(--accent-2);
}

.tabs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 93%;
  padding: 0 2px;
  margin: 0;
  position: relative;
  z-index: auto;
}

.tab {
  --tab-paper-edge: polygon(
    0.8% 8.2%, 3.2% 6.8%, 8.4% 5.2%, 16.8% 4.6%, 30.2% 4.2%, 43.8% 4.1%, 57.8% 4.2%,
    71.6% 4.7%, 83.8% 5.4%, 92.8% 6.8%, 98.8% 8.8%,
    99.4% 23.1%, 99.2% 39.2%, 99.3% 55.7%, 99.2% 72.4%, 99.4% 100%,
    95.6% 100%, 84.2% 100%, 72.1% 100%, 58.4% 100%, 44.1% 100%,
    30.4% 100%, 16.6% 100%, 5.4% 100%, 1.2% 100%,
    0.7% 72.4%, 0.8% 55.4%, 0.7% 39.1%, 0.8% 23.1%
  );
  width: calc(50% - 4px);
  background:
    var(--paper-fiber-lines),
    linear-gradient(180deg, #cca978 0%, #c09362 56%, #9b6632 100%);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  color: #2c2116;
  border: 1px solid rgba(96, 67, 35, 0.5);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  padding: 12px 14px 14px;
  margin-bottom: 0;
  cursor: pointer;
  letter-spacing: 0.01em;
  opacity: 0.96;
  box-shadow:
    inset 0 1px rgba(255, 239, 213, 0.18),
    inset 0 -1px rgba(61, 39, 18, 0.12),
    0 10px 18px rgba(0, 0, 0, 0.12);
  position: relative;
  clip-path: var(--tab-paper-edge);
  z-index: 1;
  transform: none;
  transition: background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.tab.active {
  background:
    var(--paper-fiber-lines),
    var(--paper-grad-light);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  color: #2c2116;
  opacity: 1;
  padding-top: 16px;
  margin-bottom: 2px;
  z-index: 3;
  box-shadow:
    0 -3px 12px rgba(247, 242, 233, 0.1),
    inset 0 1px rgba(255, 255, 255, 0.72);
}

.tab:not(.active) {
  z-index: 1;
  opacity: 0.94;
  margin-bottom: -4px;
  box-shadow:
    inset 0 1px rgba(255, 239, 213, 0.16),
    0 4px 8px rgba(0, 0, 0, 0.08);
}

.entry-paper {
  --entry-paper-edge: polygon(
    0.5% 1.2%, 4.2% 1.2%, 10.8% 1.05%, 22% 1.02%, 34% 1.01%, 46% 1%, 58% 1.01%, 70% 1.02%,
    82% 1.04%, 92.5% 1.2%, 100.7% 1.2%,
    98.8% 18%, 98.4% 31.2%, 98.8% 44.3%, 98.3% 57.4%, 98.7% 70.5%, 98.1% 83.5%,
    99% 95%, 94.4% 94.8%, 88% 95.2%, 80.3% 94.9%, 72.4% 95.4%, 60.3% 95%, 56.2% 95.5%,
    48.1% 94.9%, 40.1% 95.4%, 32.1% 95%, 24.2% 95.4%, 16.2% 94.9%, 2.3% 95.2%, 1.8% 94.3%,
    1.6% 90.2%, 2% 79.9%, 1.5% 67.2%, 2% 54.6%, 1.5% 42.1%, 2% 29.6%, 1.5% 17%
  );
  position: relative;
  width: 100%;
  margin: 0 0 18px;
  margin-top: -12px;
  padding: 34px 24px 42px;
  background: none;
  border: 0;
  clip-path: var(--entry-paper-edge);
  z-index: 2;
  box-shadow:
    0 18px 26px rgba(0, 0, 0, 0.18);
}

.entry-paper::before,
.entry-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: var(--entry-paper-edge);
  pointer-events: none;
}

.entry-paper::before {
  inset: 1px 0 0;
  background: none;
  z-index: -2;
  filter: blur(0.4px);
}

.entry-paper::after {
  inset: 2px;
  background:
    var(--paper-fiber-lines),
    var(--paper-grad-warm);
  box-shadow:
    inset 0 0 0 1px rgba(132, 95, 44, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    inset 0 -2px 0 rgba(132, 95, 44, 0.14);
  z-index: -1;
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  opacity: 1;
  filter: none;
}

.entry-panel-copy {
  margin-bottom: 22px;
  color: var(--text);
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.entry-paper .entry-panel-copy {
  color: #352619;
}

label {
  display: block;
  margin: 18px 0 2px;
  letter-spacing: 0.03em;
}

.entry-paper label,
.entry-paper .helper,
.entry-paper .muted {
  color: #4c3720;
}

.entry-paper input,
.entry-paper textarea,
.entry-paper select {
  background:
    linear-gradient(180deg, rgba(255, 242, 214, 0.06), rgba(0, 0, 0, 0) 36%),
    #241b14;
  border-color: rgba(97, 66, 31, 0.55);
  color: #f5e7c8;
  box-shadow:
    inset 0 1px rgba(255, 240, 214, 0.05),
    inset 0 -1px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 245, 226, 0.18);
}

.entry-paper input::placeholder,
.entry-paper textarea::placeholder {
  color: rgba(245, 231, 200, 0.48);
}

input,
textarea,
select {
  --field-torn-edge: polygon(
    1% 4.1%, 4.5% 3.3%, 11.4% 2.9%, 20.2% 3.2%, 30.3% 2.8%, 40.6% 3.2%, 51% 2.9%, 61.2% 3.3%,
    71.2% 2.9%, 80.8% 3.3%, 89.6% 3%, 95.6% 3.5%, 99% 4.2%,
    99.1% 16.8%, 98.8% 29.4%, 99.1% 42.1%, 98.8% 54.9%, 99.1% 67.5%, 98.8% 80.1%, 98.3% 92.2%,
    94.8% 93.5%, 88% 93.2%, 78.4% 93.8%, 68.8% 93.3%, 59.2% 93.9%, 49.6% 93.4%, 39.8% 93.9%, 30.1% 93.3%,
    20.4% 93.8%, 11.3% 93.2%, 4.7% 92.8%, 1.2% 92.1%,
    0.9% 80.2%, 1.2% 67.6%, 0.9% 55%, 1.2% 42.3%, 0.9% 29.7%, 1.2% 17.1%
  );
  width: 100%;
  border: 1px solid rgba(242, 191, 91, 0.42);
  border-radius: 16px;
  background: #040301;
  color: var(--text);
  padding: 14px 16px;
  font-family: Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.022em;
  line-height: 1.55;
  outline: none;
  clip-path: var(--field-torn-edge);
  box-shadow:
    inset 0 0 0 1px rgba(82, 56, 26, 0.54),
    inset 0 1px rgba(255, 255, 255, 0.06),
    inset 0 -1px rgba(0, 0, 0, 0.14);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

input[type="file"] {
  padding: 11px 12px;
  font-size: 0.86rem;
}

.file-input-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker {
  position: relative;
  display: grid;
  gap: 0;
  align-content: start;
  min-width: 0;
  filter: drop-shadow(0 4px 8px rgba(64, 43, 18, 0.34));
}

.file-picker-button,
button.file-picker-button {
  display: inline-flex;
  width: 150px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px 16px;
  color: #f6e0a3;
  background:
    radial-gradient(circle at 12% 16%, rgba(152, 108, 48, 0.08), transparent 21%),
    radial-gradient(circle at 84% 12%, rgba(152, 108, 48, 0.06), transparent 19%),
    linear-gradient(180deg, #e3c68d, #ccb175);
  border: 1px solid rgba(122, 90, 45, 0.4);
  box-shadow:
    inset 0 1px rgba(255, 249, 232, 0.42),
    inset 0 -1px rgba(115, 84, 42, 0.1),
    0 12px 22px rgba(64, 43, 18, 0.34);
  clip-path: polygon(
    1.8% 9.1%, 5.8% 6.2%, 12.8% 5.4%, 21.2% 6%, 30.4% 5.3%, 39.8% 6.1%, 49.6% 5.5%, 59.3% 6.2%,
    68.8% 5.4%, 78.1% 6.3%, 87.1% 5.6%, 94.1% 6.6%, 97.6% 9.1%,
    98.4% 19.2%, 97.9% 31.1%, 98.5% 43.3%, 97.8% 55.5%, 98.4% 67.7%, 97.9% 79.4%, 97.1% 89.6%,
    93.9% 93.8%, 86.3% 93.2%, 76.9% 94%, 67.6% 93.3%, 58.4% 94.1%, 49.1% 93.4%, 39.7% 94%, 30.3% 93.2%,
    20.9% 93.9%, 12.5% 93.1%, 5.2% 92.6%, 2% 88.4%,
    1.4% 78.3%, 2% 66.4%, 1.4% 54.4%, 2% 42.1%, 1.5% 29.9%, 2.1% 18.4%
  );
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(64, 43, 18, 0.3));
  font-family: Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: #2d2112;
}

textarea {
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--focus-edge-paper);
  background:
    linear-gradient(180deg, rgba(255, 196, 168, 0.1), rgba(0, 0, 0, 0) 42%),
    #040301;
  box-shadow: var(--focus-shadow-ring);
}

button:focus-visible,
.tab:focus-visible,
.ghost:focus-visible,
.primary:focus-visible {
  outline: none;
  border-color: var(--focus-edge-paper);
  box-shadow:
    var(--focus-shadow-ring),
    0 6px 16px rgba(0, 0, 0, 0.18);
}

.tab:focus-visible {
  z-index: 5;
}

.file-picker:focus-within .file-picker-button {
  outline: none;
  border-color: var(--focus-edge-paper);
  box-shadow:
    var(--focus-shadow-ring),
    0 4px 10px rgba(84, 58, 24, 0.14);
}

.book-page:focus-visible {
  outline: none;
  border-color: var(--focus-edge-paper);
  box-shadow:
    var(--focus-shadow-ring),
    inset 0 0 0 5px rgba(92, 70, 42, 0.055),
    inset 0 0 28px rgba(112, 89, 55, 0.15),
    0 22px 46px rgba(0, 0, 0, 0.26);
}

.book-page:focus-visible::before {
  inset: 9px;
  border: 1.5px solid rgba(255, 231, 214, 0.95);
  clip-path: var(--book-page-edge);
}

button:focus:not(:focus-visible),
.tab:focus:not(:focus-visible),
.ghost:focus:not(:focus-visible),
.primary:focus:not(:focus-visible),
.book-page:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
.suggestion-card:focus:not(:focus-visible),
.dictionary-card:focus:not(:focus-visible) {
  outline: none;
}

@supports not selector(:focus-visible) {
  button:focus,
  .tab:focus,
  .ghost:focus,
  .primary:focus,
  .book-page:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: none;
    box-shadow: var(--focus-shadow-ring);
  }
}

input::placeholder,
textarea::placeholder {
  color: rgba(247, 242, 233, 0.48);
  font-weight: 300;
  letter-spacing: 0.02em;
}

#hostNameInput,
#playerNameInput {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button {
  --button-torn-edge: polygon(
    0.7% 3.2%, 5.6% 2.6%, 14.1% 2.2%, 25% 2.6%, 37% 2.1%, 49.8% 2.5%, 62.6% 2.1%, 74.8% 2.6%,
    85.9% 2.2%, 94.5% 2.8%, 99.3% 3.3%,
    99.4% 17.3%, 99.1% 31.4%, 99.4% 45.6%, 99.1% 59.7%, 99.4% 73.9%, 99.1% 87.9%, 98.5% 96.3%,
    93.8% 96.8%, 85.5% 96.4%, 74.8% 96.9%, 62.7% 96.5%, 50% 96.9%, 37.2% 96.5%, 25.1% 96.9%, 14.3% 96.4%,
    5.8% 96.8%, 0.8% 96.1%,
    0.6% 88%, 0.9% 73.9%, 0.6% 59.8%, 0.9% 45.7%, 0.6% 31.6%, 0.9% 17.5%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  position: relative;
  isolation: isolate;
  padding: 14px 18px;
  font-family: Georgia, serif;
  font-weight: 600;
  font-style: italic;
  font-size: 1rem;
  letter-spacing: 0.032em;
  cursor: pointer;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.14),
    inset 0 -1px rgba(0, 0, 0, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.16);
  transition:
    transform 120ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
  clip-path: var(--button-torn-edge);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.08);
}

.primary {
  background:
    linear-gradient(180deg, rgba(255, 242, 205, 0.18), rgba(0, 0, 0, 0) 42%),
    linear-gradient(180deg, #f3c86d, #e0ab44);
  border-color: rgba(116, 78, 26, 0.32);
  color: #21180a;
}

.primary:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 247, 223, 0.22), rgba(0, 0, 0, 0) 42%),
    linear-gradient(180deg, #f6d487, #e7b756);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -1px rgba(0, 0, 0, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.18);
}

.entry-paper .primary {
  background:
    linear-gradient(180deg, rgba(255, 236, 190, 0.12), rgba(0, 0, 0, 0) 40%),
    linear-gradient(180deg, #d6a34b, #b67e2f);
  border-color: rgba(98, 63, 23, 0.44);
  box-shadow:
    inset 0 1px rgba(255, 236, 201, 0.16),
    inset 0 -1px rgba(85, 53, 21, 0.12),
    0 8px 12px rgba(64, 43, 18, 0.44);
}

.entry-paper .primary:focus-visible {
  outline: none;
  border-color: var(--focus-edge-paper);
  box-shadow:
    var(--focus-shadow-ring),
    0 8px 16px rgba(84, 58, 24, 0.24);
}

.entry-paper .primary.full {
  --primary-full-edge: polygon(
    0.5% 2.7%, 6.7% 2.2%, 16.5% 1.9%, 28.2% 2.3%, 39.9% 1.9%, 50% 2.4%, 60.2% 1.9%, 71.9% 2.3%,
    83.6% 1.9%, 93.3% 2.3%, 99.5% 2.8%,
    99.6% 17.5%, 99.2% 32%, 99.6% 46.5%, 99.2% 61%, 99.6% 75.4%, 99.2% 89.8%, 98.5% 96.6%,
    92.8% 97.2%, 83.1% 96.8%, 71.5% 97.3%, 60% 96.9%, 50% 97.4%, 40% 96.9%, 28.4% 97.3%, 16.8% 96.8%,
    7.1% 97.2%, 0.7% 96.5%,
    0.5% 89.8%, 0.8% 75.3%, 0.5% 60.8%, 0.8% 46.3%, 0.5% 31.8%, 0.8% 17.3%
  );
  margin-top: 48px;
  margin-bottom: 8px;
  padding: 24px 18px;
  clip-path: var(--primary-full-edge);
  box-shadow:
    inset 0 1px rgba(255, 236, 201, 0.16),
    inset 0 -1px rgba(85, 53, 21, 0.12);
  filter: drop-shadow(0 6px 10px rgba(64, 43, 18, 0.34));
}

.entry-paper .primary:hover:not(:disabled) {
  background:
    linear-gradient(180deg, rgba(255, 241, 208, 0.14), rgba(0, 0, 0, 0) 40%),
    linear-gradient(180deg, #dfb15f, #c28d3f);
  box-shadow:
    inset 0 1px rgba(255, 236, 201, 0.18),
    inset 0 -1px rgba(85, 53, 21, 0.14);
  filter: drop-shadow(0 6px 10px rgba(64, 43, 18, 0.38));
}

.ghost {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0) 46%),
    rgba(24, 29, 39, 0.82);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost:hover:not(:disabled) {
  border-color: rgba(242, 191, 91, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0) 46%),
    rgba(28, 34, 46, 0.9);
}

.small {
  padding: 9px 12px;
  border-radius: 999px;
}

.full {
  width: 100%;
  margin-top: 16px;
}

.inline {
  display: flex;
  gap: 10px;
}

.inline input {
  flex: 1;
}

.entry-onboarding-link {
  justify-self: center;
  margin-top: -8px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  color: #e5c978;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
}

.entry-onboarding-link:hover {
  color: #f3d889;
  transform: none;
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 300;
}

.option-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

.room-code-card {
  display: inline-grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  text-align: left;
  color: #f7f2e9;
}

.room-code-card .eyebrow {
  margin-bottom: 0;
  color: #f7f2e9;
  font-weight: 300;
}

.room-context-row {
  display: flex;
  align-items: end;
  width: 100%;
  border: 0;
  padding: 6px;
  align-items: center;
  border-radius: 8px;
  justify-content: space-between;
  gap: 18px;
}

.room-leave-btn {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top, 0px));
  right: 24px;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(16, 20, 28, 0.18);
  font-size: 0.82rem;
  opacity: 0.78;
}

.room-leave-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.current-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.current-player-badge span {
  max-width: 12ch;
}

.room-code-card strong {
  color: #f7f2e9;
  font-size: 1.5rem;
  letter-spacing: 0.16em;
  line-height: 0.98;
}

.players {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
}

.player-rank-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 0;
}

.player-rank-item + .player-rank-item {
  border-top: 1px solid rgba(116, 83, 42, 0.24);
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 7px 12px;
  width: 100%;
  background: rgba(36, 43, 56, 0.78);
  border: 1px solid var(--line);
  color: var(--text);
  letter-spacing: 0.026em;
}

.paper-player-chip {
  padding: 0;
  background: transparent;
  border: 0;
  color: #2a2117;
  box-shadow: none;
}

.player-rank {
  display: inline-block;
  min-width: 1ch;
  flex: 0 0 auto;
  color: #b9852a;
  font-family: "Germania One", Georgia, serif;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1;
}

.player-chip span {
  min-width: 0;
}

.player-name-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.name-ellipsis {
  display: inline-block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.player-name-line .name-ellipsis,
.score-player .name-ellipsis {
  flex: 1 1 auto;
}

.player-role {
  color: var(--muted);
}

.player-points {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.paper-player-chip .player-points {
  color: #8f5a1a;
}

.paper-player-chip .avatar {
  width: 52px;
  height: 52px;
  border: 2px solid #7c5b30;
  box-shadow:
    0 0 0 2px rgba(245, 228, 189, 0.92),
    0 0 0 4px rgba(112, 82, 40, 0.42);
  background:
    /* radial-gradient(circle at 30% 25%, rgba(188, 133, 54, 0.24), transparent 35%),
    rgba(227, 209, 170, 0.85); */
}

.ranking-paper {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin-bottom: 28px;
  padding: 36px 34px 30px;
  isolation: isolate;
  --paper-cut-edge: polygon(
    0.9% 2.5%, 4.3% 1.8%, 10.8% 1.4%, 18.3% 1.9%, 25.9% 1.3%, 33.4% 2%, 40.8% 1.4%, 48.8% 2%,
    56.5% 1.3%, 64.2% 2%, 71.8% 1.4%, 79.6% 2.1%, 87.2% 1.5%, 94.8% 2.2%, 99% 2.9%,
    99.2% 12.4%, 98.9% 21.2%, 99.2% 30%, 98.9% 38.9%, 99.2% 47.7%, 98.9% 56.5%, 99.2% 65.4%, 98.9% 74.2%,
    99.2% 83%, 98.7% 91.8%, 95.2% 95.6%, 88.4% 96.2%, 80.5% 95.7%, 72.7% 96.3%, 65% 95.7%, 57.1% 96.2%,
    49.4% 95.6%, 41.5% 96.2%, 33.8% 95.7%, 25.9% 96.3%, 18.2% 95.7%, 10.5% 96.2%, 4% 95.5%,
    1% 91.8%, 1.3% 83.1%, 1% 74.3%, 1.3% 65.5%, 1% 56.7%, 1.3% 47.9%, 1% 39.1%, 1.3% 30.3%,
    1% 21.5%, 1.3% 12.7%
  );
}

.ranking-paper::before,
.ranking-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: var(--paper-cut-edge);
}

.ranking-paper::before {
  display: none;
}

.ranking-paper::after {
  inset: 1.5px;
  background:
    var(--paper-fiber-lines),
    var(--paper-grad-warm);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  box-shadow:
    inset 0 0 0 1px rgba(142, 103, 48, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(124, 88, 37, 0.13);
  z-index: -1;
}

.ranking-paper h3 {
  margin: 0 0 20px;
  color: #362618;
  font-family: "Germania One", Georgia, serif;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0;
  line-height: 0.98;
}

.host-panel {
  margin-top: 32px;
}

.host-panel .divider {
  display: none;
}

.host-panel h3 {
  margin-top: 18px;
}

.waiting {
  margin-top: 20px;
  color: var(--muted);
}

.dictionary-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 94px;
}

.word-picker-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: stretch;
}

.word-picker-controls input {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.word-picker-controls button {
  padding-inline: 12px;
}

.random-word-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 118px;
  border-color: rgba(242, 191, 91, 0.38);
  color: var(--accent);
  font-size: 0.98rem;
  line-height: 1;
}

.random-word-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.suggestion-card {
  position: relative;
  width: 100%;
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 32px 24px;
  text-align: left;
  background: #242b38;
  color: var(--text);
  border: 1px solid var(--line);
  font-family: Georgia, serif;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.022em;
  line-height: 1.35;
}

.suggestion-card:hover {
  border-color: rgba(242, 191, 91, 0.55);
}

.suggestion-card.exact-match {
  border-color: var(--accent);
  background:
    linear-gradient(90deg, rgba(242, 191, 91, 0.14), rgba(36, 43, 56, 0) 42%),
    #242b38;
}

.suggestion-card strong {
  color: var(--accent);
  font-size: 1.22rem;
  line-height: 1.05;
}

.suggestion-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.dictionary-card {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 10px;
  min-width: 0;
  width: 100%;
  text-align: left;
  background: var(--card-soft);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 32px 24px;
  border-radius: 18px;
  font-family: Georgia, serif;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.022em;
  line-height: 1.62;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.dictionary-card:hover:not(:disabled) {
  border-color: rgba(242, 191, 91, 0.55);
}

.suggestion-card:focus-visible,
.dictionary-card:focus-visible {
  outline: none;
  border-color: var(--focus-edge-paper);
  background:
    linear-gradient(180deg, rgba(255, 196, 168, 0.08), rgba(0, 0, 0, 0) 38%),
    var(--card-soft);
}

.suggestion-card:focus-visible {
  box-shadow: var(--focus-shadow-ring);
}

.dictionary-card:focus-visible {
  box-shadow: var(--focus-shadow-card);
}

.dictionary-card.selected {
  border-color: var(--accent);
  background: rgba(242, 191, 91, 0.13);
}

.dictionary-card.selected:focus-visible {
  border-color: var(--focus-edge-paper);
  box-shadow: var(--focus-shadow-card);
}

.dictionary-radio {
  grid-row: 1 / span 2;
  width: 19px;
  height: 19px;
  margin-top: 3px;
  border: 1px solid rgba(242, 191, 91, 0.62);
  border-radius: 999px;
  background: rgba(16, 20, 28, 0.44);
  box-shadow: inset 0 0 0 4px rgba(16, 20, 28, 0.95);
}

.dictionary-card.selected .dictionary-radio {
  background: var(--accent);
}

.dictionary-card strong {
  display: block;
  min-width: 0;
  margin-bottom: 7px;
  color: var(--accent);
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.dictionary-card > span:not(.dictionary-radio) {
  min-width: 0;
}

.start-round-sticky,
.vote-confirm-button,
.vote-results-sticky,
.vote-results-sticky-secondary,
.results-round-actions,
.results-final-actions {
  position: fixed;
  left: max(var(--fixed-cta-side-gap), calc((100vw - min(100vw, var(--app-max-width))) / 2 + var(--app-shell-padding)));
  right: max(var(--fixed-cta-side-gap), calc((100vw - min(100vw, var(--app-max-width))) / 2 + var(--app-shell-padding)));
  bottom: calc(var(--fixed-cta-bottom-offset) + env(safe-area-inset-bottom, 0px));
  width: auto;
  z-index: 12;
  margin-top: 0;
}

.start-round-sticky,
.vote-confirm-button,
.vote-results-sticky {
  background:
    linear-gradient(180deg, rgba(255, 242, 205, 0.18), rgba(0, 0, 0, 0) 42%),
    linear-gradient(180deg, #f3c86d, #e0ab44);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34);
}

.vote-results-sticky-secondary {
  background:
    linear-gradient(180deg, rgba(255, 242, 205, 0.18), rgba(0, 0, 0, 0) 42%),
    linear-gradient(180deg, #f3c86d, #e0ab44);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  border-color: rgba(181, 121, 12, 0.95);
  color: #3b2500;
}

#gameScreen:has(#lobbyView:not(.hidden) .start-round-sticky:not(:disabled))::after,
#gameScreen:has(#writingView:not(.hidden) .vote-results-sticky:not(.hidden))::after,
#gameScreen:has(#writingView:not(.hidden) .vote-results-sticky-secondary:not(.hidden))::after,
#gameScreen:has(#votingView:not(.hidden) .vote-confirm-button:not(.hidden))::after,
#gameScreen:has(#votingView:not(.hidden) .vote-results-sticky:not(.hidden))::after,
#gameScreen:has(#votingView:not(.hidden) .vote-results-sticky-secondary:not(.hidden))::after,
#gameScreen:has(#resultsView:not(.hidden) #resultsRoundActions:not(.hidden))::after,
#gameScreen:has(#resultsView:not(.hidden) #finalRoundActions:not(.hidden))::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--fixed-cta-strip-height) + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.82) 100%);
  backdrop-filter: blur(6px) saturate(68%);
  -webkit-backdrop-filter: blur(6px) saturate(68%);
  pointer-events: none;
  z-index: 11;
}

#gameScreen:has(#resultsView:not(.hidden) #finalRoundActions:not(.hidden))::after {
  height: calc(108px + env(safe-area-inset-bottom, 0px));
}

#gameScreen:has(#resultsView:not(.hidden) #resultsRoundActions:not(.hidden))::after {
  height: calc(108px + env(safe-area-inset-bottom, 0px));
}

.results-final-actions,
.results-round-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.results-round-actions .primary.full,
.results-final-actions .primary.full {
  margin-top: 0;
  margin-bottom: 0;
}

.results-exit-link {
  align-self: center;
  border: 0;
  border-radius: 0;
  background: none;
  color: rgba(244, 228, 194, 0.92);
  box-shadow: none;
  clip-path: none;
  padding: 2px 6px;
  font-size: 0.95rem;
  letter-spacing: 0.018em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.results-exit-link:hover:not(:disabled) {
  transform: none;
  border: 0;
  background: none;
  box-shadow: none;
  color: #f7dcaa;
}

.results-exit-link:focus-visible {
  outline: 2px solid rgba(242, 191, 91, 0.8);
  outline-offset: 3px;
}

.start-round-sticky:disabled {
  position: static;
  left: auto;
  bottom: auto;
  width: 100%;
  transform: none;
  z-index: auto;
  margin-top: 16px;
  box-shadow: none;
}

.word {
  font-size: clamp(2.7rem, 12vw, 6.4rem);
  color: var(--accent);
  margin: 8px 0 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 0.95;
}

.word,
#resultWord,
.book-word,
.voted-word {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.progress-box {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 16px;
  background: #040301;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 300;
  letter-spacing: 0.022em;
}

.writing-help p {
  margin-bottom: 0;
}

.writing-status-copy {
  margin-top: 12px;
  font-size: 1.06rem;
}

.writing-timer {
  margin: 6px 0 10px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.score-help {
  margin: 0 0 12px;
}

.submitted-definition {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(242, 191, 91, 0.24);
  border-radius: 16px;
  background: rgba(4, 3, 1, 0.62);
  color: var(--text);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.022em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.definitions,
.revealed,
.score-list {
  display: grid;
  gap: 10px;
}

.definition-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  text-align: left;
  color: #352619;
  background:
    var(--paper-fiber-lines),
    var(--paper-grad-warm);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  border: 1px solid rgba(142, 103, 48, 0.28);
  border-radius: 18px;
  padding: 32px 24px;
  font-family: Georgia, serif;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.022em;
  line-height: 1.62;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.definition-card .definition-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.definition-card:hover:not(:disabled) {
  border-color: rgba(142, 103, 48, 0.5);
}

.definition-card:disabled {
  opacity: 0.45;
}

.definition-card strong {
  display: block;
  margin-bottom: 7px;
  color: #7a4f1f;
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.truth-box {
  padding: 32px 24px;
  border-radius: 20px;
  border: 1px solid rgba(242, 191, 91, 0.34);
  background: rgba(242, 191, 91, 0.12);
  margin-bottom: 22px;
}

.truth-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.truth-box p {
  margin-bottom: 0;
  color: var(--text);
  font-weight: 300;
  letter-spacing: 0.022em;
  line-height: 1.62;
}

.revealed-card,
.score-row {
  background:
    var(--paper-fiber-lines),
    var(--paper-grad-warm);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  border: 1px solid rgba(142, 103, 48, 0.28);
  border-radius: 18px;
}

.revealed-card {
  padding: 32px 24px;
  color: #352619;
  font-weight: 300;
  letter-spacing: 0.022em;
  line-height: 1.62;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.revealed-card.real-definition {
  background-blend-mode: lighten;
}

.revealed-card .meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8f5a1f;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.score-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-width: 0;
  width: 100%;
  padding: 16px 24px;
}

.score-rank-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
}

.score-player {
  display: inline-flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 12px;
  min-width: 0;
}

.score-player strong {
  flex: 1 1 auto;
  min-width: 0;
  color: #3a2a1b;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.score-player .avatar {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(242, 191, 91, 0.5);
  box-shadow:
    0 0 0 2px rgba(16, 20, 28, 0.92),
    0 0 0 4px rgba(242, 191, 91, 0.18);
}

.score-row > span {
  flex: 0 0 auto;
  color: #5f4528;
  font-weight: 500;
  letter-spacing: 0.022em;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .intro-layout {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
    gap: 34px;
  }

  .intro-copy {
    justify-self: end;
  }

  .intro-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .onboarding-shell {
    padding-top: 12px;
    align-content: center;
  }

  .onboarding-paper {
    max-width: 1080px;
  }

  .onboarding-figure {
    min-height: min(72vh, 760px);
  }

  .onboarding-overlay {
    right: auto;
    width: min(56%, 560px);
    padding: 24px 22px 22px;
  }

  .onboarding-footer {
    width: min(340px, 100%);
    justify-items: center;
  }

  .onboarding-cta {
    width: min(260px, 100%);
  }

  .room-code-card strong {
    font-size: 2.1rem;
  }

  .word {
    font-size: 3.4rem;
  }

  .players,
  .score-list,
  .ranking-paper {
    width: min(100%, 620px);
  }

  .ranking-paper {
    padding: 42px 40px 34px;
  }

  .entry-paper {
    width: min(100%, 620px);
    padding: 36px 32px 46px;
  }

  .tabs {
    width: min(100%, 620px);
  }
}

code {
  color: var(--accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-style: normal;
  font-size: 0.92em;
}

a {
  color: var(--accent-2);
}


/* Modal de encuadre de avatar */
.crop-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 12, 0.76);
  backdrop-filter: blur(10px);
}

.crop-card {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  background: rgba(27, 32, 43, 0.98);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.options-modal-paper {
  position: relative;
  z-index: 1;
  color: #352619;
  padding: 40px 34px 48px;
  margin: 0;
  margin-top: 0;
  align-self: center;
  justify-self: center;
  transform: none;
  max-width: 94vw;
}

.options-modal-paper h2 {
  color: #352619;
  margin-bottom: 52px;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  line-height: 1.05;
}

.force-voting-paper {
  max-width: min(560px, 94vw);
}

.force-voting-copy {
  color: #4c3720;
  margin: -22px 0 32px;
}

.options-modal-paper label {
  color: #4c3720;
  margin-top: 0;
  margin-bottom: 8px;
}

.rounds-limit-toggle {
  margin-top: 22px;
  color: #5a4123;
  gap: 12px;
}

.rounds-limit-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.paper-checkbox {
  position: relative;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background:
    var(--paper-fiber-lines),
    linear-gradient(180deg, #f4e7c7, #dfc891);
  background-size: var(--paper-surface-size);
  background-repeat: var(--paper-surface-repeat);
  background-blend-mode: var(--paper-surface-blend);
  border: 2px solid rgba(143, 101, 38, 0.56);
  box-shadow:
    inset 0 1px rgba(255, 253, 244, 0.78),
    inset 0 -1px rgba(126, 87, 39, 0.14),
    0 4px 10px rgba(86, 60, 24, 0.18);
}

.paper-checkbox::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 4px;
  opacity: 0;
  background:
    linear-gradient(135deg, transparent 42%, #fff6e8 42%, #fff6e8 58%, transparent 58%),
    linear-gradient(45deg, transparent 56%, #fff6e8 56%, #fff6e8 70%, transparent 70%);
  transform: rotate(-8deg);
}

.rounds-limit-toggle input:checked + .paper-checkbox {
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #b97b1d, #9f6510);
  border-color: rgba(106, 70, 19, 0.52);
  box-shadow:
    inset 0 1px rgba(255, 239, 207, 0.22),
    0 4px 10px rgba(86, 53, 13, 0.18);
}

.rounds-limit-toggle input:checked + .paper-checkbox::after {
  opacity: 1;
}

.rounds-limit-field {
  margin-top: 12px;
  margin-bottom: 32px;
}

.rounds-limit-field.hidden {
  margin-top: 0;
  margin-bottom: 0;
}

.rounds-limit-field.hidden + label {
  margin-top: 48px;
}

.rounds-limit-field input {
  max-width: 180px;
}

.options-modal-paper .pill {
  --pill-paper-edge: polygon(
    1.2% 8.4%, 4.2% 5.2%, 10.8% 4.1%, 20.4% 4.7%, 31.3% 4.1%, 42.1% 4.8%, 53.1% 4.2%, 63.8% 4.9%,
    74.4% 4.2%, 84.2% 4.8%, 91.6% 4.2%, 96.4% 5.6%, 98.7% 8.5%,
    98.9% 24.6%, 98.5% 40.5%, 98.9% 56.2%, 98.4% 71.8%, 97.5% 86.5%, 94.2% 92.2%, 87.3% 94.1%,
    77.8% 93.4%, 67.9% 94.3%, 57.8% 93.5%, 47.8% 94.2%, 37.8% 93.5%, 27.7% 94.3%, 17.8% 93.4%,
    9.1% 94.1%, 3.3% 91.4%, 1.4% 85.6%, 1% 70.8%, 1.3% 55.4%, 1% 39.8%, 1.4% 23.8%
  );
  color: #f5e7c8;
  background:
    linear-gradient(180deg, rgba(255, 242, 214, 0.06), rgba(0, 0, 0, 0) 36%),
    #241b14;
  border: 1px solid rgba(97, 66, 31, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(82, 56, 26, 0.54),
    inset 0 1px rgba(255, 240, 214, 0.05),
    inset 0 -1px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 245, 226, 0.18);
  border-radius: 16px;
  clip-path: var(--pill-paper-edge);
  padding: 10px 16px;
}

.options-modal-paper .pill.selected {
  color: #fff7ea;
  background:
    linear-gradient(180deg, rgba(255, 242, 214, 0.06), rgba(0, 0, 0, 0) 36%),
    #ac7016;
  border-color: rgba(126, 79, 16, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(132, 87, 23, 0.62),
    inset 0 1px rgba(255, 233, 190, 0.14),
    inset 0 -1px rgba(89, 54, 7, 0.18),
    0 2px 8px rgba(96, 60, 12, 0.18);
}

.options-modal-paper .pill-group {
  margin-top: 26px;
  margin-bottom: 74px;
  gap: 8px;
}

.options-modal-paper label + .pill-group {
  margin-top: 16px;
}

.options-modal-paper .crop-actions.single-action {
  grid-template-columns: 1fr;
  justify-items: end;
  margin-top: 0;
}

.options-modal-paper .crop-actions.single-action .primary {
  min-width: 220px;
  width: 100%;
}

.crop-canvas-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  max-width: 100%;
  margin: 18px auto;
  border-radius: 999px;
  overflow: hidden;
  background: #040301;
  border: 1px solid var(--line);
  touch-action: none;
}

#avatarCropCanvas {
  display: block;
  width: 280px;
  height: 280px;
  max-width: 100%;
  cursor: grab;
  touch-action: none;
}

#avatarCropCanvas:active {
  cursor: grabbing;
}

.crop-circle {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(242, 191, 91, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.crop-actions button {
  width: 100%;
}


@media (max-width: 660px) {
  :root {
    --app-shell-padding: 16px;
  }

  html {
    font-size: 17px;
  }

  .app {
    margin: 0 auto;
    padding: calc(var(--app-shell-padding) + env(safe-area-inset-top, 0px)) var(--app-shell-padding) var(--app-shell-padding);
  }

  body.intro-active .app,
  body.onboarding-active .app {
    width: 100%;
  }

  .welcome-screen,
  .onboarding-shell {
    min-height: calc(var(--viewport-height) - (var(--app-shell-padding) * 2));
  }

  .intro-layout {
    gap: 18px;
    min-height: calc(var(--viewport-height) - (var(--app-shell-padding) * 2));
    align-content: start;
    overflow: hidden;
  }

  .intro-illustration-card {
    height: var(--intro-mobile-image-height);
    min-height: 0;
  }

  .intro-copy {
    max-width: none;
    align-content: start;
    gap: 4px;
    padding-bottom: 0;
  }

  .intro-title {
    font-size: 3.2rem;
  }

  .intro-subtitle {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 1rem;
    line-height: 1.32;
  }

  .intro-copy .eyebrow {
    font-size: 0.68rem;
    margin-bottom: 2px;
  }

  .intro-actions {
    width: 100%;
    max-width: none;
    margin-top: 10px;
  }

  .onboarding-shell {
    align-content: start;
  }

  .onboarding-paper {
    width: min(100%, 420px);
  }

  .onboarding-figure {
    height: var(--onboarding-mobile-figure-height);
    min-height: 0;
  }

  .onboarding-skip {
    top: 24px;
    right: 15px;
  }

  .onboarding-footer {
    width: min(100%, 420px);
  }

  .onboarding-overlay {
    left: 14px;
    right: 14px;
    bottom: var(--onboarding-mobile-overlay-bottom);
    padding: 18px 18px 17px;
  }

  .intro-art-image,
  .intro-art-image {
    object-position: center center;
  }

  #onboardingImage {
    object-position: center bottom;
  }

  .onboarding-cta {
    width: 100%;
  }

  .hero {
    display: block;
    margin-bottom: 28px;
  }

  .app-mark {
    width: auto;
    height: 78px;
    max-width: 180px;
    margin-bottom: 16px;
  }

  .entry-compact h1 {
    font-size: 3.3rem;
  }

  .card,
  .notice {
    border-radius: 22px;
    padding: 32px 24px;
  }

  .inline {
    flex-direction: column;
  }

  .word-picker-controls {
    grid-template-columns: 1fr 1fr;
  }

  .word-picker-controls input {
    grid-column: 1 / -1;
  }

  .game-context-bar {
    width: 100%;
    margin-top: 16px;
  }

  .room-context-row {
    align-items: center;
  }

  .room-code-card {
    min-width: 0;
    justify-items: end;
    text-align: right;
  }

  .current-player-badge {
    max-width: 100%;
  }

  h1 {
    font-size: 3.3rem;
    letter-spacing: 0.028em;
  }

  .is-playing h1 {
    font-size: 2.3rem;
    letter-spacing: 0;
  }

  .is-playing .hero {
    margin-bottom: 14px;
  }

  .word {
    letter-spacing: 0.032em;
  }

  #gameScreen {
    --fixed-cta-side-gap: 24px;
  }
}


.waiting strong {
  color: var(--accent);
  font-weight: 600;
}


/* Patch v9: definición votada */
.voted-definition {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(16, 20, 28, 0.72);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.022em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.voted-word {
  margin-top: 0;
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.05;
}


/* Patch v10: votación seleccionable */
.definition-card {
  position: relative;
}

.definition-card.is-selected {
  border-color: var(--accent);
  background: rgba(242, 191, 91, 0.13);
}

.selection-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  place-items: center;
  background: rgba(242, 191, 91, 0.18);
  border: 1px solid rgba(242, 191, 91, 0.6);
  color: var(--accent);
  font-size: 0.78rem;
  line-height: 1;
}

.definition-card.is-selected .selection-indicator {
  display: grid;
}

.vote-monitor-card {
  cursor: default;
  padding: 32px 24px;
}

.vote-monitor-card:hover {
  border-color: var(--line);
}

.live-vote-count {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(214, 166, 84, 0.18);
  border: 1px solid rgba(156, 108, 44, 0.44);
  color: #8f5a1f;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.vote-monitor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 7px;
}

.vote-monitor-header strong {
  min-width: 0;
  margin-bottom: 0;
}

.vote-monitor-header .live-vote-count,
.vote-monitor-header .definition-author {
  flex: 0 0 auto;
}

.voter-list {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(132, 95, 44, 0.2);
  color: #5e4529;
  font-size: 0.92rem;
  line-height: 1.42;
}

.voter-label {
  color: #be7a2a;
  font-weight: 600;
  margin-right: 6px;
}

.voter-names {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 4px 8px;
  vertical-align: top;
  color: #7a4f1f;
  font-weight: 600;
}

.voter-names .name-ellipsis {
  max-width: 18ch;
}

.voter-empty {
  color: #8a6a43;
  font-style: italic;
}

.vote-deck {
  display: block;
}

.book-stack {
  position: relative;
  min-height: 350px;
  display: grid;
  place-items: stretch;
  perspective: 1200px;
  --swipe-progress: 0;
  --swipe-abs: 0;
  --previous-reveal: 0;
  --next-reveal: 0;
  --both-reveal: 0;
}

.book-page {
  --book-page-edge: polygon(
    1.2% 4.2%, 4.1% 4.4%, 11.1% 3.8%, 20.5% 4.2%, 30.5% 3.7%, 40.7% 4.3%, 51% 3.8%, 61.3% 4.4%,
    71.1% 3.8%, 80.8% 4.5%, 90.4% 3.9%, 95.7% 4.7%, 98.4% 4.1%,
    98.8% 18.9%, 98.4% 31.1%, 98.9% 43.4%, 98.4% 55.7%, 98.8% 68%, 98.4% 80.1%, 97.8% 90.2%,
    97.8% 94.5%, 87.6% 93.9%, 3.3% 94.7%, 68.8% 94.1%, 59.2% 94.8%, 49.7% 94.2%, 40% 94.8%, 30.5% 94.1%,
    20.9% 94.7%, 12.2% 94.9%, 2.2% 94.3%, 1.9% 89%,
    1.4% 79.2%, 1.9% 67.2%, 1.3% 55.2%, 1.8% 43%, 2.3% 30.8%, 1.9% 18.6%
  );
  position: relative;
  z-index: 1;
  min-height: 338px;
  padding: 34px 28px 30px;
  border: 1px solid rgba(92, 70, 42, 0.38);
  border-radius: 7px 13px 10px 8px;
  background:
    var(--paper-fiber-lines),
    radial-gradient(circle at 8% 12%, rgba(116, 84, 42, 0.16), transparent 16%),
    radial-gradient(circle at 96% 8%, rgba(116, 84, 42, 0.11), transparent 14%),
    radial-gradient(circle at 4% 92%, rgba(116, 84, 42, 0.12), transparent 13%),
    linear-gradient(90deg, rgba(112, 89, 55, 0.16), transparent 11%, transparent 90%, rgba(112, 89, 55, 0.11)),
    repeating-linear-gradient(0deg, rgba(42, 36, 28, 0.055) 0 1px, transparent 1px 31px),
    linear-gradient(180deg, #f9edd1 0%, #efd9ad 36%, #e3c58d 100%);
  background-size: 520px auto, auto, auto, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-blend-mode: multiply, normal, normal, normal, normal, normal;
  color: #2d2418;
  box-shadow:
    inset 0 0 0 5px rgba(92, 70, 42, 0.055),
    inset 0 0 28px rgba(112, 89, 55, 0.15),
    0 22px 46px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transform-origin: 50% 72%;
  will-change: transform, box-shadow, opacity;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
  clip-path: var(--book-page-edge);
}

.word,
#realDefinitionText,
#resultWord,
.voted-definition,
.revealed-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.book-page.is-dragging {
  transition: none;
}

.book-page.is-springing {
  transition:
    transform 560ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 560ms cubic-bezier(0.22, 1, 0.36, 1);
}

.book-page.is-exiting-left,
.book-page.is-exiting-right {
  transition:
    transform 340ms cubic-bezier(0.2, 0.78, 0.18, 1),
    opacity 300ms ease,
    box-shadow 340ms ease;
}

.book-page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(92, 70, 42, 0.24);
  border-radius: 5px 11px 8px 6px;
  clip-path: var(--book-page-edge);
  pointer-events: none;
}

.book-page::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  clip-path: var(--book-page-edge);
  background:
    linear-gradient(90deg, rgba(92, 70, 42, 0.18), transparent 6%, transparent 94%, rgba(92, 70, 42, 0.12)),
    radial-gradient(circle at 0 0, rgba(92, 70, 42, 0.15), transparent 18%),
    radial-gradient(circle at 100% 100%, rgba(92, 70, 42, 0.12), transparent 16%);
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
}

.book-page.is-selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(242, 191, 91, 0.5),
    0 22px 46px rgba(0, 0, 0, 0.3);
}

.book-page.is-own {
  cursor: not-allowed;
  background:
    var(--paper-fiber-lines),
    radial-gradient(circle at 8% 12%, rgba(116, 84, 42, 0.18), transparent 16%),
    radial-gradient(circle at 96% 8%, rgba(116, 84, 42, 0.12), transparent 14%),
    radial-gradient(circle at 4% 92%, rgba(116, 84, 42, 0.13), transparent 13%),
    linear-gradient(90deg, rgba(112, 89, 55, 0.18), transparent 11%, transparent 90%, rgba(112, 89, 55, 0.12)),
    repeating-linear-gradient(0deg, rgba(42, 36, 28, 0.055) 0 1px, transparent 1px 31px),
    linear-gradient(180deg, #f6e7c5 0%, #ecd5a7 36%, #dcbf86 100%);
  background-size: 520px auto, auto, auto, auto, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-blend-mode: multiply, normal, normal, normal, normal, normal;
}

.book-page-preview {
  position: absolute;
  inset: 18px 12px 6px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  filter: saturate(0.92);
  overflow: hidden;
  transition:
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease,
    filter 260ms ease;
}

.preview-previous {
  transform: translate3d(var(--previous-x, -26px), var(--previous-y, 10px), -70px) rotateZ(var(--previous-rotate, -2.8deg)) scale(var(--previous-scale, 0.96));
  opacity: var(--previous-opacity, 0);
}

.preview-next {
  transform: translate3d(var(--next-x, 26px), var(--next-y, 10px), -70px) rotateZ(var(--next-rotate, 2.8deg)) scale(var(--next-scale, 0.96));
  opacity: var(--next-opacity, 0);
}

.preview-both {
  transform: translate3d(var(--both-x, 0), var(--both-y, 10px), -70px) rotateZ(var(--both-rotate, 0deg)) scale(var(--both-scale, 0.96));
  opacity: var(--both-opacity, 0);
}

.book-page-preview .book-word {
  font-size: clamp(1.5rem, 7vw, 3rem);
}

.book-page-preview .book-definition {
  max-height: 150px;
  overflow: hidden;
  opacity: 0.55;
}

.book-word {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 24px;
  color: #6a4f24;
  font-size: clamp(1.9rem, 8vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-align: center;
}

.book-definition {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
  min-height: 160px;
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.62;
  color: #1f170f;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-character: "-";
}

.book-note {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(112, 89, 55, 0.2);
  color: rgba(45, 36, 24, 0.66);
  font-size: 0.9rem;
  line-height: 1.35;
}

.book-vote-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(112, 89, 55, 0.2);
  color: rgba(45, 36, 24, 0.74);
  font-size: 0.95rem;
  line-height: 1.35;
}

.book-vote-radio {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 12, 7, 0.96) 0 46%, transparent 47%),
    linear-gradient(180deg, rgba(120, 90, 50, 0.86), rgba(76, 55, 29, 0.92));
  border: 1px solid rgba(95, 68, 34, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 236, 0.34),
    inset 0 -1px 2px rgba(28, 18, 8, 0.24);
}

.book-page.is-selected .book-vote-row {
  color: rgba(45, 36, 24, 0.9);
}

.book-page.is-selected .book-vote-radio {
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 191, 91, 0.98) 0 42%, transparent 43%),
    linear-gradient(180deg, rgba(120, 90, 50, 0.86), rgba(76, 55, 29, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 236, 0.38),
    inset 0 -1px 2px rgba(28, 18, 8, 0.2);
}

.deck-position {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.deck-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.writing-monitor {
  margin-top: 18px;
}

.writing-monk-wrap {
  margin-top: 18px;
  display: grid;
  justify-items: center;
}

.writing-monk {
  width: auto;
  height: 200px;
  max-width: min(240px, 56vw);
  opacity: 0.92;
}

.writing-truth-box {
  margin-bottom: 18px;
}

.writing-monitor-card {
  cursor: default;
}

.writing-monitor-card:hover {
  border-color: var(--line);
}

.writing-monitor-card > span {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  color: #2f2318;
}

.definition-author {
  max-width: min(44vw, 18ch);
  color: var(--muted);
  font-weight: 600;
  text-align: right;
  letter-spacing: 0.03em;
}

.definition-author.name-ellipsis {
  color: #7a4f1f;
}

.writing-empty {
  margin-top: 0;
}

.score-points {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 8px;
  color: #5f4528;
  white-space: nowrap;
}

.score-points .score-round {
  color: #be7a2a;
  font-weight: 600;
}

.score-points .score-total {
  color: #8f5a1f;
  font-weight: 700;
}

.score-divider {
  color: rgba(92, 69, 41, 0.42);
}

.dictionary-card.exact-match {
  border-color: var(--accent);
  background: rgba(242, 191, 91, 0.13);
}

.notice,
.suggestion-card,
.dictionary-card,
.definition-card,
.progress-box,
.submitted-definition,
.voted-definition,
.truth-box,
.revealed-card,
.score-row {
  clip-path: polygon(
    0.7% 3.4%, 5.3% 2.8%, 13.8% 2.4%, 24.8% 2.8%, 37% 2.3%, 49.9% 2.7%, 62.7% 2.3%, 74.8% 2.8%,
    86% 2.4%, 94.8% 2.9%, 99.4% 3.5%,
    99.5% 17.5%, 99.2% 31.6%, 99.5% 45.7%, 99.2% 59.8%, 99.5% 73.9%, 99.2% 88%, 98.5% 96.3%,
    93.8% 96.8%, 85.5% 96.4%, 74.8% 96.9%, 62.7% 96.5%, 50% 96.9%, 37.2% 96.5%, 25.1% 96.9%, 14.3% 96.4%,
    5.8% 96.8%, 0.8% 96.1%,
    0.6% 88%, 0.9% 73.9%, 0.6% 59.8%, 0.9% 45.7%, 0.6% 31.6%, 0.9% 17.5%
  );
}

.card,
.notice,
.avatar,
input,
textarea,
select,
button,
.small,
.player-chip,
.suggestion-card,
.dictionary-card,
.definition-card,
.progress-box,
.submitted-definition,
.voted-definition,
.truth-box,
.revealed-card,
.score-row,
.crop-card,
.crop-canvas-wrap,
#avatarCropCanvas,
.room-leave-btn,
.book-page,
.book-page::before,
.book-page::after,
.book-page-preview {
  border-radius: 8px;
}
