:root {
  --surface: #f7faf7;
  --surface-low: #f1f4f1;
  --surface-lowest: #ffffff;
  --surface-high: #e8ede8;
  --surface-highest: #dfe6df;
  --text: #18211b;
  --muted: #5b685d;
  --primary: #006b32;
  --primary-strong: #008741;
  --primary-soft: #e3f6e8;
  --secondary: #d4ec49;
  --secondary-ink: #495400;
  --danger: #ba1a1a;
  --danger-soft: #ffe3e0;
  --warning-soft: #fff2c7;
  --line: #d7e1d7;
  --line-strong: #c2d0c2;
  --shadow-sm: 0 18px 40px rgba(20, 40, 23, 0.045);
  --shadow-md: 0 22px 52px rgba(20, 40, 23, 0.06);
  --shadow-lg: 0 28px 72px rgba(20, 40, 23, 0.075);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background-color: #eff4ef;
  background:
    radial-gradient(circle at top left, rgba(212, 236, 73, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 135, 65, 0.08), transparent 24%),
    linear-gradient(180deg, #f7faf7 0%, #f3f6f2 52%, #eff4ef 100%);
  overscroll-behavior-y: none;
}

body {
  position: relative;
  color: var(--text);
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(212, 236, 73, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(0, 135, 65, 0.08), transparent 24%),
    linear-gradient(180deg, #f7faf7 0%, #f3f6f2 52%, #eff4ef 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  width: min(1720px, calc(100% - 20px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.site-header h1,
.panel-title,
.archive-title,
.leader-row strong,
.timer-copy strong,
.code-block .mono,
.stat-card strong {
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.header-copy {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.98rem;
}

.app-root {
  min-height: 70vh;
}

body.player-landing .app-shell {
  width: min(1000px, calc(100% - 32px));
  padding-top: 16px;
  padding-bottom: 24px;
}

body.player-landing .site-header {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

body.player-landing .site-header h1 {
  font-size: clamp(2rem, 8vw, 3rem);
}

body.player-landing .header-copy {
  max-width: 300px;
  font-size: 0.95rem;
}

body.player-landing .app-root {
  min-height: auto;
}

body.player-immersed .site-header {
  display: none;
}

body.player-immersed .app-shell {
  padding-top: 10px;
  overflow-x: clip;
}

body.player-immersed .app-root {
  min-height: auto;
  overflow-x: clip;
}

.atelier-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 34%),
    linear-gradient(180deg, rgba(241, 244, 241, 0.98), rgba(239, 243, 239, 0.98));
  border-radius: 36px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.atelier-compact-layout {
  align-items: start;
  gap: 24px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.atelier-compact-layout .atelier-main,
.atelier-compact-layout .atelier-sidebar {
  padding: 0;
}

.atelier-main {
  padding: 28px 32px 36px;
  min-width: 0;
}

.atelier-sidebar {
  padding: 28px 28px 36px;
  background: rgba(241, 244, 241, 0.92);
  min-width: 0;
}
.atelier-timer-icon svg,
.tool-icon-button svg,
.atelier-sidebar-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.atelier-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
}

.atelier-prompt-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-width: 0;
  margin-bottom: 22px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.atelier-prompt-copy {
  min-width: 0;
}

.atelier-prompt-title {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.atelier-timer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 164px;
  gap: 10px;
  min-width: 164px;
  padding: 13px 20px;
  border-radius: 999px;
  color: var(--secondary-ink);
  background: var(--secondary);
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(212, 236, 73, 0.28);
}

.atelier-timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.atelier-timer-value {
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.atelier-canvas-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 16px;
}

.atelier-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  box-shadow: 0 20px 40px rgba(24, 28, 27, 0.06);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.atelier-toolbar::-webkit-scrollbar {
  display: none;
}

.atelier-tool-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.atelier-divider {
  width: 1px;
  height: 24px;
  flex: 0 0 auto;
  background: rgba(91, 104, 93, 0.18);
}

.tool-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.tool-icon-button svg {
  width: 18px;
  height: 18px;
  margin: auto;
  overflow: visible;
  transform-box: fill-box;
  transform-origin: center;
}

.studio-icon--brush {
  transform: translate(0.35px, 0.25px);
}

.studio-icon--eraser {
  transform: translate(0.45px, 0.2px);
}

.studio-icon--trash {
  transform: translate(0.2px, 0.45px);
}

.tool-icon-button.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 14px 28px rgba(0, 107, 50, 0.18);
}

.atelier-canvas {
  width: 100%;
  max-width: 1120px;
  min-height: min(68vh, 820px);
}

.atelier-cta-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.atelier-submit {
  min-width: 240px;
}

.atelier-note {
  margin-top: 18px;
  text-align: center;
}

.atelier-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.atelier-sidebar-section + .atelier-sidebar-section {
  margin-top: 34px;
}

.atelier-sidebar-card {
  padding: 18px 20px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.atelier-sidebar-card .button-row {
  gap: 10px;
}

.atelier-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.atelier-sidebar-header h3 {
  margin: 0;
  color: #2b3b2d;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.atelier-sidebar-header span {
  color: var(--primary);
  font-weight: 700;
}

.atelier-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.divider-top {
  padding-top: 24px;
  border-top: 1px solid rgba(91, 104, 93, 0.12);
}

.atelier-roster-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.atelier-player-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.atelier-player-row.self {
  box-shadow: var(--shadow-md);
}

.atelier-avatar {
  width: 50px;
  height: 50px;
  background: rgba(223, 230, 223, 0.9);
  color: #475447;
  font-size: 1.2rem;
}

.atelier-player-copy {
  flex: 1;
  min-width: 0;
}

.atelier-player-copy strong {
  display: block;
  font-size: 1.05rem;
}

.atelier-player-copy span {
  color: var(--muted);
}

.atelier-link-button {
  padding: 8px 0 0;
  color: rgba(91, 104, 93, 0.82);
  background: transparent;
  font-weight: 600;
  text-align: left;
}

.atelier-link-button:hover {
  color: var(--primary);
}

.leaderboard-sheet {
  gap: 20px;
}

.atelier-scorecard {
  padding: 10px 20px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-sm);
}

.atelier-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
}

.atelier-score-row.with-divider {
  border-bottom: 1px solid rgba(91, 104, 93, 0.08);
}

.atelier-score-copy {
  display: flex;
  align-items: center;
  gap: 16px;
}

.atelier-score-rank {
  width: 22px;
  color: rgba(73, 84, 0, 0.68);
  font-weight: 800;
}

.atelier-score-copy strong {
  font-size: 1.05rem;
}

.atelier-score-value {
  color: var(--primary);
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
}

.atelier-submitted-card {
  width: 100%;
  max-width: 1120px;
}

.grid {
  display: grid;
  gap: 24px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.main {
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  align-items: start;
}

.panel,
.form-card,
.stat-card,
.leader-row,
.member-pill,
.submission-card,
.archive-card,
.pill {
  background: rgba(255, 255, 255, 0.84);
  border: 0;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.empty-state,
.status-banner {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  backdrop-filter: none;
}

.info-chip,
.pill {
  background: rgba(255, 255, 255, 0.64);
  box-shadow: none;
  backdrop-filter: none;
}

.panel {
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.panel-inner {
  padding: 24px;
}

.panel-title {
  margin: 0 0 6px;
  font-size: 1.34rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.panel-copy,
.helper-text,
.footnote {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.88fr);
  gap: 24px;
}

.entry-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.92fr);
  gap: 28px;
  align-items: start;
}

.player-entry-stage {
  grid-template-columns: minmax(0, 560px);
  justify-content: start;
}

.entry-copy {
  padding: 28px 10px 0 2px;
}

.host-entry-copy {
  padding-top: 18px;
}

.entry-title {
  max-width: 11ch;
  margin: 0 0 14px;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.host-entry-copy .entry-title {
  max-width: 9ch;
  font-size: clamp(1.9rem, 3.3vw, 3.2rem);
}

.entry-text {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.entry-points {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.entry-point {
  max-width: 30rem;
  padding: 0 0 0 16px;
  border-left: 3px solid rgba(0, 107, 50, 0.18);
}

.entry-point strong {
  display: block;
  margin-bottom: 4px;
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
  font-size: 1.02rem;
  font-weight: 800;
}

.entry-point span {
  color: var(--muted);
  line-height: 1.55;
}

.entry-panel-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.join-entry-stack {
  width: 100%;
  max-width: 760px;
}

.entry-panel {
  padding: 22px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
}

.entry-panel-primary {
  background: rgba(255, 255, 255, 0.94);
}

.entry-panel-muted {
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.disclaimer-card {
  color: var(--text);
}

.disclaimer-copy,
.disclaimer-heading,
.disclaimer-list {
  margin: 0;
}

.disclaimer-copy,
.disclaimer-list {
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
}

.disclaimer-section {
  margin-top: 14px;
}

.disclaimer-heading {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.disclaimer-list {
  margin-top: 10px;
  padding-left: 20px;
}

.disclaimer-list li + li {
  margin-top: 10px;
}

.past-games-panel {
  opacity: 0.94;
}

.join-shell {
  max-width: 760px;
  margin: 0 auto;
}

.host-shell {
  align-items: start;
}

.hero-card {
  position: relative;
  min-height: 320px;
  padding: 32px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(212, 236, 73, 0.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(0, 135, 65, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 244, 241, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto 24px 20px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 135, 65, 0.14), transparent 72%);
  pointer-events: none;
}

.join-hero {
  min-height: 220px;
}

.join-card {
  width: min(100%, 560px);
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
}

.player-entry-stage .join-card {
  width: 100%;
  margin: 0;
}

.host-hero,
.dashboard-hero,
.archive-hero {
  background:
    radial-gradient(circle at top right, rgba(212, 236, 73, 0.24), transparent 26%),
    radial-gradient(circle at bottom left, rgba(0, 135, 65, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 244, 241, 0.92));
}

.host-entry-card {
  box-shadow: var(--shadow-md);
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.stat-card {
  padding: 16px;
  border-radius: 22px;
}

.stat-card strong {
  display: block;
  font-size: 1.55rem;
}

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

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card {
  padding: 22px;
  border-radius: var(--radius-xl);
}

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

.field label,
.field .field-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(91, 104, 93, 0.58);
  font-weight: 500;
  letter-spacing: 0;
}

.input.mono::placeholder {
  color: rgba(91, 104, 93, 0.46);
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.textarea {
  min-height: 116px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(0, 135, 65, 0.5);
  box-shadow:
    0 0 0 4px rgba(0, 135, 65, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 18px 34px rgba(0, 107, 50, 0.18);
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-strong);
}

.button.ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.button.utility-link {
  min-height: auto;
  padding: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.button.utility-link:hover {
  transform: none;
  color: var(--primary);
}

.entry-utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.entry-utility-row .helper-text {
  margin: 0;
}

.host-entry-actions {
  padding-top: 6px;
}

.pill-row,
.member-list,
.prompt-list,
.meta-row,
.gallery-grid,
.results-grid,
.leaderboard {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.info-chip,
.member-pill,
.pill {
  padding: 12px 16px;
  border-radius: 22px;
}

.info-chip strong,
.pill strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
}

.info-chip small,
.pill small,
.member-pill span {
  color: var(--muted);
}

.member-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 146px;
}

.member-pill.connected {
  border-color: rgba(0, 135, 65, 0.18);
  background: rgba(255, 255, 255, 0.92);
}

.member-pill.host {
  background: linear-gradient(180deg, rgba(212, 236, 73, 0.35), rgba(255, 255, 255, 0.92));
}

.roster-pill {
  min-height: 72px;
  justify-content: center;
}

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
}

.code-block .footnote {
  color: var(--primary);
  font-weight: 700;
}

.code-block .mono {
  color: var(--primary);
  letter-spacing: 0.18em;
}

.code-block .button-row {
  justify-content: flex-end;
}

.code-block .button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.92rem;
}

.dashboard-hero .drawing-meta {
  align-items: flex-start;
}

.dashboard-hero .panel-title,
.archive-hero .panel-title,
.host-hero .panel-title {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.side-panel-stack {
  gap: 18px;
}

.sidebar-panel {
  background: rgba(255, 255, 255, 0.78);
}

.prompt-pill {
  padding: 10px 14px;
  color: var(--secondary-ink);
  background: rgba(212, 236, 73, 0.22);
  border: 1px solid rgba(73, 84, 0, 0.08);
  border-radius: 999px;
}

.status-banner {
  padding: 16px 18px;
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
}

.status-banner strong {
  color: var(--text);
}

.status-banner.success {
  background: rgba(227, 246, 232, 0.84);
}

.status-banner.warn {
  background: rgba(255, 242, 199, 0.84);
}

.canvas-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stage-card,
.gallery-stage,
.prompt-stage {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 244, 241, 0.88));
}

.player-lobby-stage {
  max-width: 760px;
}

.player-lobby-stage .panel-inner {
  gap: 14px;
  padding: 22px 24px 24px;
}

.prompt-stage .panel-inner {
  gap: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.swatches,
.brush-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.swatch,
.brush {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 10px rgba(20, 40, 23, 0.08);
  background: transparent;
}

.swatch.active,
.brush.active,
.tool-button.active {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(0, 107, 50, 0.18);
}

.brush {
  display: grid;
  place-items: center;
  border-color: rgba(80, 95, 81, 0.12);
  background: rgba(255, 255, 255, 0.8);
}

.brush-dot {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4a5c50;
}

.tool-button {
  min-height: 46px;
  padding: 0 18px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.tool-button.active {
  color: var(--primary);
  border-color: rgba(0, 107, 50, 0.26);
  background: rgba(227, 246, 232, 0.95);
}

.drawing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.timer-stack {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(212, 236, 73, 0.26);
}

.timer-ring {
  width: 74px;
  height: 74px;
}

.timer-copy strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.timer-copy span {
  color: var(--muted);
}

.canvas-board {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 28px;
  border: 8px solid #ffffff;
  background: #ffffff;
  box-shadow: 0 20px 42px rgba(20, 40, 23, 0.08);
  touch-action: none;
}

.submission-card {
  overflow: hidden;
  border-radius: 24px;
  border: 0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
}

.submission-card.winner {
  border-color: rgba(212, 236, 73, 0.55);
  box-shadow: 0 20px 42px rgba(212, 236, 73, 0.22);
}

.submission-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f6f8f5;
}

.image-unavailable-card {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 24px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(232, 238, 227, 0.96), rgba(244, 247, 240, 0.96));
  color: #445240;
}

.image-unavailable-card strong {
  font-size: 0.95rem;
}

.image-unavailable-card span {
  max-width: 18rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.submission-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 245, 0.98));
}

.submission-meta h3,
.leader-row h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.vote-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  color: var(--secondary-ink);
  font-weight: 800;
  border-radius: 999px;
  background: rgba(212, 236, 73, 0.38);
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.98);
}

.gallery-badge--self {
  color: #566356;
  background: rgba(255, 255, 255, 0.96);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-grid--live {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery-grid--duo {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  justify-content: center;
}

.gallery-grid--single {
  grid-template-columns: minmax(280px, 420px);
  justify-content: center;
}

.gallery-grid--archive {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery-stage .gallery-grid,
.vote-stage .gallery-grid {
  gap: 20px;
}

.gallery-card .button-row {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.gallery-card--archive .submission-meta {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.gallery-card--archive .submission-meta > div:first-child {
  min-width: 0;
  flex: 1 1 140px;
}

.gallery-card--archive .button-row {
  margin-left: auto;
}

.gallery-card .button-row .button,
.gallery-card .button-row .gallery-badge,
.gallery-card .button-row .vote-badge {
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.88rem;
}

.gallery-action {
  min-height: 36px;
  padding: 0 15px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(91, 104, 93, 0.18);
  box-shadow: none;
}

.gallery-action.button.secondary {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(91, 104, 93, 0.18);
}

.gallery-action:hover {
  box-shadow: 0 8px 18px rgba(20, 40, 23, 0.08);
}

.leaderboard {
  flex-direction: column;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.archive-card {
  padding: 20px;
  border-radius: 26px;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.archive-title {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 800;
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.leader-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-radius: 24px;
}

.leader-row strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.leader-rank {
  display: inline-flex;
  width: 28px;
  justify-content: center;
  color: rgba(91, 104, 93, 0.72);
  font-weight: 800;
}

.empty-state {
  padding: 22px;
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
}

.inline-error {
  margin: 0;
  color: var(--danger);
}

.helper-text strong {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100% - 36px));
  padding: 14px 16px;
  color: #ffffff;
  background: rgba(24, 33, 27, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-state {
  display: grid;
  place-items: center;
  min-height: 50vh;
}

.loading-orb {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--secondary), var(--primary-strong));
  box-shadow: 0 18px 40px rgba(0, 107, 50, 0.18);
  animation: float 2.8s ease-in-out infinite;
}

.loading-copy {
  margin-top: 18px;
  color: var(--muted);
}

.mono {
  font-family: "Plus Jakarta Sans", "Be Vietnam Pro", sans-serif;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-10px) scale(1.04);
  }
}

@media (max-width: 1180px) {
  .grid.main {
    grid-template-columns: 1fr;
  }

  .atelier-layout {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .atelier-sidebar {
    width: 100%;
    max-width: 100%;
    padding-right: 32px;
    padding-bottom: 32px;
    padding-top: 0;
    background: transparent;
  }

  .atelier-sidebar-section,
  .leaderboard-sheet {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid--live,
  .gallery-grid--duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid--archive {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid--single {
    grid-template-columns: minmax(260px, 1fr);
  }
}

@media (max-width: 960px) {
  .site-header,
  .hero,
  .grid.two,
  .entry-stage {
    grid-template-columns: 1fr;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-copy {
    max-width: none;
  }

  .join-shell {
    max-width: 100%;
  }

  .entry-copy {
    padding: 6px 0 0;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 12px, 1720px);
    padding-top: 14px;
  }

  body.player-landing .app-shell {
    width: min(100% - 18px, 1000px);
    padding-top: 10px;
    padding-bottom: 18px;
  }

  body.player-immersed .app-shell {
    width: min(100% - 10px, 1600px);
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .hero-card,
  .form-card,
  .panel-inner,
  .archive-card {
    padding: 18px;
  }

  .hero-stat-grid,
  .grid.two {
    grid-template-columns: 1fr;
  }

  .join-hero {
    min-height: auto;
    padding: 24px 20px;
  }

  .join-card {
    width: 100%;
  }

  body.player-landing .site-header {
    gap: 8px;
    margin-bottom: 12px;
  }

  body.player-landing .header-copy {
    max-width: none;
  }

  .entry-title {
    font-size: clamp(1.9rem, 12vw, 2.8rem);
  }

  .entry-panel {
    padding: 18px;
    border-radius: 26px;
  }

  .atelier-main,
  .atelier-sidebar {
    padding: 14px;
  }

  .atelier-sidebar {
    width: 100%;
    max-width: 100%;
    padding: 0 14px 14px;
    background: transparent;
  }

  .atelier-prompt-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .atelier-prompt-card {
    gap: 14px;
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 26px;
  }

  .atelier-prompt-copy {
    width: 100%;
  }

  .atelier-prompt-title {
    font-size: clamp(1.2rem, 8vw, 1.95rem);
    line-height: 0.98;
  }

  .atelier-timer-pill {
    align-self: flex-start;
    gap: 8px;
    flex: 0 0 auto;
    min-width: 136px;
    min-height: 56px;
    padding: 0 18px;
  }

  .atelier-timer-value {
    font-size: 1.05rem;
  }

  .atelier-toolbar {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 24px;
    overflow: visible;
    mask-image: none;
  }

  .atelier-divider {
    display: none;
  }

  .atelier-tool-group {
    gap: 5px;
  }

  .atelier-tool-group,
  .brush-list {
    order: 1;
  }

  .swatches {
    order: 2;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .swatches::-webkit-scrollbar {
    display: none;
  }

  .tool-icon-button {
    width: 40px;
    min-height: 40px;
  }

  .swatches,
  .brush-list {
    gap: 6px;
  }

  .swatch,
  .brush {
    width: 28px;
    height: 28px;
  }

  .atelier-canvas {
    min-height: auto;
  }

  .atelier-canvas-shell {
    gap: 12px;
  }

  .atelier-cta-row {
    justify-content: stretch;
  }

  .drawing-meta,
  .archive-header,
  .submission-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar {
    border-radius: 28px;
    justify-content: flex-start;
    padding: 12px;
    gap: 12px;
  }

  .canvas-board {
    border-width: 5px;
    border-radius: 24px;
  }

  .button-row {
    flex-direction: column;
  }

  .leader-row {
    align-items: flex-start;
    gap: 10px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid--live,
  .gallery-grid--duo,
  .gallery-grid--single,
  .gallery-grid--archive {
    grid-template-columns: 1fr;
  }

  .vote-stage .panel-inner,
  .prompt-stage .panel-inner,
  .stage-card .panel-inner {
    gap: 16px;
  }

  .player-side-stack {
    gap: 12px;
  }

  .atelier-player-row {
    border-radius: 24px;
  }

  .atelier-submit {
    min-width: 0;
    width: 100%;
  }
}
