/* Wordichi game page styles. Split from old main.css. */
/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple-900: #26215C;
  --purple-800: #3C3489;
  --purple-600: #534AB7;
  --purple-400: #7F77DD;
  --purple-100: #CECBF6;
  --purple-50:  #EEEDFE;

  --teal-600: #0F6E56;
  --teal-400: #1D9E75;
  --teal-100: #9FE1CB;

  --amber-600: #BA7517;
  --amber-400: #EF9F27;
  --amber-200: #FAC775;
  --amber-50:  #FAEEDA;

  --coral-600: #993C1D;
  --coral-400: #D85A30;

  --red-400: #E24B4A;
  --green-400: #639922;
  --blue-400: #378ADD;

  --gray-900: #2C2C2A;
  --gray-700: #5F5E5A;
  --gray-400: #888780;
  --gray-200: #D3D1C7;
  --gray-50:  #F1EFE8;

  --bg: #0e0e1a;
  --bg2: #16162a;
  --bg3: #1e1e36;
  --border: rgba(255,255,255,0.08);
  --text: #e8e8f0;
  --text-muted: rgba(255,255,255,0.5);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --font-pixel: 'Press Start 2P', monospace;
  --font-main: 'Nunito', sans-serif;
}

html { height: 100%; touch-action: manipulation;}

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
}


body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('/static/img/body-bg.jpg') center top / cover no-repeat;
  transform: translateZ(0);
}



@media (max-width: 700px) {
  body::before {
    background-image: url('/static/img/bg-mobile.webp');
    background-position: center top;
  }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #000;
  opacity: .9;
  /*background:*/
  /*        radial-gradient(circle at 50% 12%, rgba(250,199,117,0.12), transparent 28%),*/
  /*        linear-gradient(180deg, rgba(6,18,24,0.12), rgba(14,14,26,0.76) 74%, rgba(14,14,26,0.9));*/
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 400;
  height: 56px;
  background: rgba(14,14,26,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.logo {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  color: var(--amber-200);
  text-shadow: 2px 2px 0 var(--amber-600);
  white-space: nowrap;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  padding-left: 16px;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
}
.nav-link:hover,
.nav-link.active { color: var(--text); background: rgba(255,255,255,0.07); }
.nav-link.active { color: var(--amber-200); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coins-badge {
  display: flex;
  align-items: center;
  /*gap: 5px;*/
  /*background: rgba(250,199,117,0.12);*/
  /*border: 1px solid rgba(250,199,117,0.3);*/
  /*border-radius: 20px;*/
  padding: 4px 12px;
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--amber-200);
}

.lang-select {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.lang-select:focus { border-color: var(--purple-400); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(180deg, var(--purple-400) 0%, var(--purple-600) 100%);
  border: 2px solid var(--purple-900);
  border-radius: var(--radius);
  color: white;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 20px;
  transition: all 0.15s;
  box-shadow: 0 4px 0 var(--purple-900);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--purple-900); }
.btn-primary.btn-large { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  transition: all 0.15s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.2); }

/* ── Pages ───────────────────────────────────────────────────────────────── */
#app { padding: 24px; max-width: 960px; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-card {
  max-width: 420px;
  margin: 40px auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  padding: 8px;
  transition: all 0.15s;
}
.auth-tab.active { background: var(--purple-600); color: white; }

.auth-form h2 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 20px;
  color: var(--text);
}
.auth-form label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.auth-form label span { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.auth-form input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--purple-400); }
.auth-form .btn-primary { width: 100%; margin-top: 8px; }

.auth-error {
  background: rgba(226,75,74,0.12);
  border: 1px solid rgba(226,75,74,0.3);
  border-radius: var(--radius-sm);
  color: #F09595;
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* ── Create wordichi ──────────────────────────────────────────────────────────── */
.create-wordichi-card {
  max-width: 560px;
  margin: 0px auto;
  text-align: center;
}
.create-wordichi-card h1 {
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  color: var(--amber-200);
  text-shadow: 2px 2px 0 var(--amber-600);
  margin-bottom: 24px;
}
.wordichi-name-input {
  width: 100%;
  max-width: 360px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  outline: none;
  margin-bottom: 24px;
  transition: border-color 0.15s;
}
.wordichi-name-input:focus { border-color: var(--amber-200); }
.wordichi-name-input::placeholder { color: var(--text-muted); font-weight: 400; }

.wordichi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  /*margin-bottom: 24px;*/
}
.wordichi-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  /*min-width: 90px;*/
}
.wordichi-choice:hover { background: var(--bg3); border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.wordichi-choice.selected { border-color: var(--amber-200); background: rgba(250,199,117,0.1); }
.wordichi-choice .p-emoji { font-size: 40px; }
.wordichi-choice .p-name { font-family: var(--font-pixel); font-size: 7px; color: var(--text-muted); }

/* ── Home layout ─────────────────────────────────────────────────────────── */
.home-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* ── Device ──────────────────────────────────────────────────────────────── */
.device {
  position: sticky;
  top: 80px;
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, #042e57 0%, #051223 100%);
  border: 3px solid #7e5c3b;
  border-radius: 24px 24px 44px 44px;
  /* padding: 14px; */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 0 #4b3118, inset 0 2px 0 rgba(255, 255, 255, 0.12);
  /*position: sticky;*/
  /*top: 80px;*/
  /*width: 240px;*/
  /*min-width: 240px;*/
  /*background: linear-gradient(180deg, var(--purple-600) 0%, var(--purple-800) 100%);*/
  /*border: 3px solid var(--purple-900);*/
  /*border-radius: 24px 24px 44px 44px;*/
  /*padding: 14px;*/
  /*display: flex;*/
  /*flex-direction: column;*/
  /*align-items: center;*/
  /*gap: 10px;*/
  /*box-shadow: 0 8px 0 var(--purple-900), inset 0 2px 0 rgba(255,255,255,0.12);*/
}

.device-screen {
  width: 100%;
  /* background: #fff; */
  background-image: url("/static/img/bg.jpg");
  background-size: 100%;
  border-radius: 20px;
  border-bottom: 1px solid #c79f66;
  /*width: 210px;*/
  height: 210px;
  /* background: #0a1a0a; */
  /* border: 3px solid var(--purple-900); */
  /* border-radius: 14px; */
  position: relative;
  overflow: hidden;
  /* box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.6);
/*width: 210px;*/


  /*height: 210px;*/
  /*background: #0a1a0a;*/
  /*border: 3px solid var(--purple-900);*/
  /*border-radius: 14px;*/
  /*position: relative;*/
  /*overflow: hidden;*/
  /*box-shadow: inset 0 0 30px rgba(0,0,0,0.6);*/
}

.device-jew {
  width: 62px;
  height: 31px;
  background-image: url("/static/img/devicejew.png");
  background-size: 64px;
  position: absolute;
  background-repeat: no-repeat;
  z-index: 99;
  top: -17px;
  /*width: 100px;*/
  /*height: 50px;*/
  /*background-image: url("/static/img/devicejew.png");*/
  /*position: absolute;*/
}

#bg-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }

.speech-bubble {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.92);
  color: var(--gray-900);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 10;
}
.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255,255,255,0.92);
}
.speech-bubble.show { opacity: 1; }

.wordichi-sprite {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 4rem;
  cursor: pointer;
  user-select: none;
  animation: idle 1.4s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  z-index: 5;
  transition: filter 0.2s;
  text-align: center;
}
.wordichi-sprite:hover { filter: brightness(1.2) drop-shadow(0 3px 10px rgba(255,230,100,0.5)); }

@keyframes idle {
  0%, 100% { bottom: 30px; }
  50% { bottom: 36px; }
}
@keyframes wordichi-happy {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(-50%) rotate(-20deg); }
  75% { transform: translateX(-50%) rotate(20deg); }
}
@keyframes wordichi-eat {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.2); }
}
@keyframes wordichi-sleep {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.coins-badge, .level-badge {
  position: absolute;
  font-family: var(--font-pixel);
  font-size: .6rem;
  /*background: rgba(0,0,0,0.55);*/
  /*border-radius: 5px;*/
  padding: 3px 7px;
  color: rgba(255,255,255,0.75);
}
.coins-badge { top: 8px; right: 8px; }
.level-badge { top: 8px; left: 8px; color: var(--amber-200); }

.xp-bar-wrap {
  width: 100%;
  height: 5px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 2px;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-400), var(--amber-200));
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}

.stats-panel { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.stat-row { display: flex; align-items: center; gap: 6px; }
.stat-icon { font-size: 13px; width: 18px; text-align: center; }
 .stat-bg {
  position: relative;
  flex: 1;
  height: 16px;
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
}
.stat-fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.stat-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 0 5px rgba(0,0,0,0.45);
  pointer-events: none;
  z-index: 2;
}


.energy-regen-wrap {
  position: relative;
  margin: -1px 0 2px 24px;
}
.energy-regen-track {
  height: 5px;
  background: rgba(0,0,0,0.32);
  border-radius: 999px;
  overflow: hidden;
  cursor: help;
}
.energy-regen-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(127,119,221,0.45), rgba(190,185,255,0.95));
  box-shadow: 0 0 10px rgba(127,119,221,0.55);
  transition: width 0.25s linear;
}
.energy-regen-wrap.is-full .energy-regen-fill {
  width: 100%;
  background: linear-gradient(90deg, rgba(34,197,94,0.55), rgba(134,239,172,0.95));
  box-shadow: 0 0 10px rgba(34,197,94,0.45);
}
.energy-regen-wrap::before,
.energy-regen-wrap::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 6px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 40;
}
.energy-regen-wrap::before {
  content: attr(data-tooltip);
  min-width: max-content;
  max-width: 190px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.96), rgba(88, 80, 210, 0.94));
  border: 1px solid rgba(213, 210, 255, 0.28);
  box-shadow: 0 12px 28px rgba(0,0,0,0.34), 0 0 18px rgba(127,119,221,0.26);
  color: rgba(255,255,255,0.96);
  font-family: var(--font-pixel);
  font-size: 6px;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
}
.energy-regen-wrap::after {
  content: '';
  bottom: calc(100% + 4px);
  width: 10px;
  height: 10px;
  background: rgba(68, 60, 176, 0.96);
  border-right: 1px solid rgba(213, 210, 255, 0.22);
  border-bottom: 1px solid rgba(213, 210, 255, 0.22);
  transform: translate(-50%, 6px) rotate(45deg);
}
.energy-regen-wrap:hover::before,
.energy-regen-wrap:hover::after,
.energy-regen-wrap:focus-visible::before,
.energy-regen-wrap:focus-visible::after {
  opacity: 1;
}
.energy-regen-wrap:hover::before,
.energy-regen-wrap:focus-visible::before {
  transform: translate(-50%, 0);
}
.energy-regen-wrap:hover::after,
.energy-regen-wrap:focus-visible::after {
  transform: translate(-50%, 0) rotate(45deg);
}

.actions-grid {
  position: relative;
  z-index: 99;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}
.action-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: white;
  transition: all 0.12s;
}
.action-btn:hover { background: rgba(255,255,255,0.15); transform: translateY(-1px); }
.action-btn:active { transform: translateY(1px); }
.action-btn .a-icon { font-size: 18px; }
.action-btn .a-label { font-family: var(--font-pixel); font-size: 6px; color: rgba(255,255,255,0.75); }
.action-btn .a-cost { font-size: 8px; color: var(--amber-200); }
.action-btn .a-effects {
  justify-content: center;
  max-width: 100%;
  margin-top: 1px;
}
.action-btn .effect-pill {
  padding: 2px 4px;
  border-radius: 999px;
  font-size: 8px;
}
.action-btn .effect-pill b {
  font-size: 8px;
  min-width: auto;
}
.action-btn .effect-pill em {
  font-size: 8px;
}

.effect-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.effect-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  line-height: 1;
  white-space: nowrap;
}
.effect-pill b {
  font-style: normal;
  font-weight: 900;
  font-size: 10px;
  min-width: 10px;
  text-align: center;
}
.effect-pill em {
  font-style: normal;
  font-weight: 900;
  font-size: 10px;
}
.effect-pill-good {
  color: rgba(214,255,235,0.96);
  background: rgba(29,158,117,0.13);
  border-color: rgba(159,225,203,0.24);
}
.effect-pill-bad {
  color: rgba(255,214,214,0.96);
  background: rgba(226,75,74,0.12);
  border-color: rgba(226,75,74,0.24);
}

.earn-btn {
  width: 100%;
  background: linear-gradient(180deg, var(--amber-200) 0%, var(--amber-400) 100%);
  border: 2px solid var(--amber-600);
  border-radius: var(--radius);
  font-family: var(--font-pixel);
  font-size: 9px;
  color: #412402;
  padding: 11px;
  box-shadow: 0 4px 0 var(--amber-600);
  transition: all 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.earn-btn:hover { filter: brightness(1.05); }
.earn-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--amber-600); }

/* ── Right panel ─────────────────────────────────────────────────────────── */
.right-panel { flex: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-title {
  font-family: var(--font-pixel);
  font-size: 1.1rem;
  color: var(--amber-200);
}

/*.coins-badge span:first-child {*/
/*  transform: translateY(-3px);*/
/*  font-size: 1rem;*/
/*}*/

.wordichi-info-header { display: flex; align-items: center; gap: 14px; }
.wordichi-big-emoji { font-size: 48px; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4)); }
.wordichi-name-display { font-size: 22px; font-weight: 900; color: var(--text); }
.wordichi-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Shop ────────────────────────────────────────────────────────────────── */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.shop-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s;
  cursor: pointer;
}
.shop-card:hover { background: var(--bg3); border-color: rgba(250,199,117,0.3); transform: translateY(-2px); }
.shop-card:active { transform: translateY(0); }
.shop-card.cant-afford { opacity: 0.45; cursor: not-allowed; }
.sc-emoji { font-size: 36px; }
.sc-info { flex: 1; }
.sc-name { font-weight: 900; font-size: 15px; }
.sc-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sc-effects { margin-top: 7px; }
.sc-effects .effect-pill { padding: 4px 7px; }
.sc-price {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--amber-200);
  background: rgba(250,199,117,0.1);
  border: 1px solid rgba(250,199,117,0.25);
  border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg3);
  border: 1px solid rgba(250,199,117,0.35);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--amber-200);
  line-height: 1.8;
  z-index: 999;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.3s;
  pointer-events: none;
  max-width: 260px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── Particles ───────────────────────────────────────────────────────────── */
.particle {
  position: absolute;
  pointer-events: none;
  animation: pfloat 1.2s ease-out forwards;
  font-size: 20px;
  z-index: 20;
}
@keyframes pfloat {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(1.6); }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .home-layout { flex-direction: column; align-items: center; }
  .device { width: 100%; position: static;}
  .device-jew {top: 58px;}
  .right-panel { width: 100%; }
  .topbar-nav { display: none; }
  #app { padding: 16px; }
}


/* ── Wordichi page shop + level guide ───────────────────────────────────────── */
.xp-bar-wrap { position: relative; height: 14px; }
.xp-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-pixel);
  /*font-size: 6px;*/
  color: rgba(255,255,255,0.78);
  /*text-shadow: 0 1px 2px rgba(0,0,0,0.8);*/
  pointer-events: none;
  /* background: #ffd700; */
  color: white;
  /* -webkit-text-stroke: 1px black; */
  text-shadow: 1px 1px 4px black;
  /* width: max-content; */
  /* margin: auto; */
  /* background: rgba(0, 0, 0, 0.2); */
  font-size: 7px;
}
.shop-panel { border-color: rgba(250,199,117,0.18); }
.shop-grid-compact { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.shop-grid-compact .shop-card { padding: 12px; border-radius: var(--radius); }
.shop-grid-compact .sc-emoji { font-size: 30px; }
.shop-grid-compact .sc-name { font-size: 14px; }
.shop-grid-compact .sc-price { font-size: 8px; padding: 5px 8px; }
.level-guide { background: linear-gradient(180deg, rgba(250,199,117,0.08), rgba(127,119,221,0.06)); }
.guide-list { display: grid; gap: 8px; color: var(--text-muted); font-size: 13px; }
.guide-list div {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
}
@media (max-width: 680px) {
  .shop-grid-compact { grid-template-columns: 1fr; }
}


/* ── Level up popup ─────────────────────────────────────────────────────── */
.levelup-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at 50% 35%, rgba(250,199,117,0.24), rgba(11,15,30,0.78) 42%, rgba(6,8,16,0.9));
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.levelup-modal.show { opacity: 1; pointer-events: auto; }
.levelup-card {
  position: relative;
  width: min(420px, 100%);
  overflow: hidden;
  text-align: center;
  padding: 28px 24px 22px;
  border-radius: 28px;
  border: 1px solid rgba(250,199,117,0.45);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.04)),
    linear-gradient(135deg, rgba(127,119,221,0.95), rgba(31,41,82,0.98) 46%, rgba(15,24,44,0.98));
  box-shadow: 0 30px 90px rgba(0,0,0,0.5), 0 0 45px rgba(250,199,117,0.2);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.24s cubic-bezier(.2,1.2,.2,1);
}
.levelup-modal.show .levelup-card { transform: translateY(0) scale(1); }
.levelup-card > *:not(.levelup-confetti) { position: relative; z-index: 1; }
.levelup-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}
.levelup-confetti-piece {
  position: absolute;
  top: -22px;
  font-size: 18px;
  animation: levelup-confetti-fall 1.15s cubic-bezier(.15,.75,.2,1) forwards;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.28));
}
.levelup-burst {
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 8px;
  color: var(--amber-200);
  text-shadow: 0 0 18px rgba(250,199,117,0.75);
  animation: levelup-pop 0.8s ease both;
}
.levelup-wordichi-icon {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  margin: 12px auto 10px;
  font-size: 54px;
  border-radius: 28px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 18px 42px rgba(0,0,0,0.25);
  animation: levelup-wordichi-bounce 1.1s ease infinite;
}
.levelup-card h2 {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 18px;
  line-height: 1.5;
  color: #fff7d6;
  text-shadow: 0 0 20px rgba(250,199,117,0.55);
}
.levelup-card p {
  margin: 8px 0 16px;
  color: rgba(255,255,255,0.78);
  font-weight: 800;
}
.levelup-benefits {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}
.levelup-benefit {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 16px;
  color: rgba(255,255,255,0.9);
  font-weight: 900;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
}
.levelup-benefit-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(250,199,117,0.16);
  flex: 0 0 auto;
}
.levelup-close {
  width: 100%;
  min-height: 46px;
}
@keyframes levelup-pop {
  0% { transform: translateY(8px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes levelup-confetti-fall {
  0% { transform: translate3d(0, -18px, 0) rotate(0deg) scale(0.7); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate3d(var(--x), 260px, 0) rotate(var(--r)) scale(1); opacity: 0; }
}
@keyframes levelup-wordichi-bounce {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}
@media (max-width: 480px) {
  .levelup-card { padding: 24px 18px 18px; border-radius: 22px; }
  .levelup-card h2 { font-size: 15px; }
  .levelup-wordichi-icon { width: 76px; height: 76px; font-size: 46px; }
}

/* Client-only build tweaks */
.wordichi-name-input:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.74);
  color: #1f2937;
  font-weight: 900;
  text-align: center;
}

/* Buddy picker: keep button visible, scroll only skins grid */
#create-wordichi-card,
.create-wordichi-card,
.wordichi-create-card {
  /*max-height: min(92vh, 760px);*/
  display: flex;
  flex-direction: column;
  /*overflow: hidden;*/
  align-items: center;
}

#wordichi-grid,
.wordichi-grid {
  flex: 1;
  min-height: 0;
  /*max-height: 360px;*/
  /*overflow-y: auto;*/
  padding-right: 6px;
  padding-top: 3px;
  /*overscroll-behavior: contain;*/
}

/* button area always visible */
#adopt-btn {
  position: sticky;
  bottom: 4px;
  flex-shrink: 0;
  /*margin-top: 16px;*/
  opacity: 1;
}

#adopt-btn:disabled {
  display: none;
}

/* optional: prettier scroll */
#wordichi-grid::-webkit-scrollbar,
.wordichi-grid::-webkit-scrollbar {
  width: 8px;
}

#wordichi-grid::-webkit-scrollbar-thumb,
.wordichi-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .25);
  border-radius: 999px;
}

#wordichi-grid::-webkit-scrollbar-track,
.wordichi-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
}

.buddy-name-box,
.buddy-name-box * {
  box-sizing: border-box;
}

.buddy-name-box {
  /*width: 620px;*/
  /*max-width: calc(100vw - 40px);*/
  width: 100%;
  height: 3.5rem;
  /*height: 86px;*/
  margin: 0 auto 24px;

  display: flex;
  align-items: center;

  border-radius: 26px;
  border: 4px solid #303045;
  background: #171725;

  box-shadow:
          inset 0 4px 0 rgba(255,255,255,.05),
          inset 0 -5px 0 rgba(0,0,0,.22),
          0 10px 0 rgba(0,0,0,.25);
  /*overflow: hidden;*/
}

.buddy-name-box__label {
  height: 100%;
  display: flex;
  align-items: center;
  /* justify-content: center; */
  color: #f4bd55;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .025);
  border-right: 3px solid #303045;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .55), 0 0 12px rgba(244, 189, 85, .22);
  padding: 0 1rem;
}

.buddy-name-box__input {
  flex: 1;
  min-width: 0;
  height: 100%;

  border: 0;
  outline: 0;
  /*padding: 0 24px;*/
  margin: 0;

  background: transparent;
  box-shadow: none;

  color: #fff;
  -webkit-text-fill-color: #fff;
  opacity: 1;

  font-size: 32px;
  font-weight: 900;
  letter-spacing: .06em;
  /*text-align: center;*/
  padding-left: 1rem;
  cursor: not-allowed;
}

.buddy-name-box__input:disabled {
  opacity: 1;
}

.buddy-name-box__signin {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  border: 0;
  border-left: 3px solid #303045;
  border-radius: 0 22px 22px 0;
  background: rgba(255,255,255,.025);
  color: #f4bd55;
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(0,0,0,.55), 0 0 12px rgba(244,189,85,.22);
  padding: 0 1rem;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  white-space: nowrap;
}

.buddy-name-box__signin:hover {
  background: rgba(244,189,85,.10);
  color: #ffd88a;
}

.buddy-name-box__signin:active {
  transform: translateY(2px);
}


.buddy-server-box,
.buddy-server-box * {
  box-sizing: border-box;
}

.buddy-server-box {
  width: 100%;
  height: 3.5rem;
  margin: -10px auto 24px;
  display: flex;
  align-items: center;
  border-radius: 26px;
  border: 4px solid #303045;
  background: #171725;
  box-shadow:
          inset 0 4px 0 rgba(255,255,255,.05),
          inset 0 -5px 0 rgba(0,0,0,.22),
          0 10px 0 rgba(0,0,0,.25);
  overflow: hidden;
}

.buddy-server-box__label {
  height: 100%;
  display: flex;
  align-items: center;
  color: #f4bd55;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  background: rgba(255,255,255,.025);
  border-right: 3px solid #303045;
  text-shadow: 0 3px 0 rgba(0,0,0,.55), 0 0 12px rgba(244,189,85,.22);
  padding: 0 1rem;
}

.buddy-server-box__select {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  margin: 0;
  padding: 0 3rem 0 1rem;
  appearance: none;
  -webkit-appearance: none;
  background:
          linear-gradient(45deg, transparent 50%, #f4bd55 50%) calc(100% - 1.35rem) 50% / 8px 8px no-repeat,
          linear-gradient(135deg, #f4bd55 50%, transparent 50%) calc(100% - 0.95rem) 50% / 8px 8px no-repeat,
          transparent;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .04em;
  cursor: pointer;
}

.buddy-server-box__select:focus {
  background-color: rgba(244,189,85,.08);
}

.buddy-server-box__select option {
  color: #111827;
  background: #fff;
}


.buddy-server-dropdown {
  position: fixed;
  z-index: 2600;
  display: none;
  max-height: min(340px, calc(100vh - 28px));
  padding: 8px;
  border: 3px solid #303045;
  border-radius: 22px;
  background:
          radial-gradient(circle at 18% 0%, rgba(244,189,85,.18), transparent 34%),
          linear-gradient(180deg, #222238 0%, #151522 100%);
  box-shadow:
          inset 0 3px 0 rgba(255,255,255,.07),
          inset 0 -4px 0 rgba(0,0,0,.25),
          0 18px 0 rgba(0,0,0,.22),
          0 22px 42px rgba(0,0,0,.45);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.buddy-server-dropdown.is-open {
  display: block;
}

.buddy-server-dropdown::-webkit-scrollbar {
  width: 8px;
}

.buddy-server-dropdown::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.buddy-server-dropdown::-webkit-scrollbar-thumb {
  background: rgba(244,189,85,.42);
  border-radius: 999px;
}

.buddy-server-dropdown__item {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: rgba(255,255,255,.86);
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: .02em;
  text-align: left;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .14s ease, color .14s ease, transform .14s ease;
}

.buddy-server-dropdown__item:hover,
.buddy-server-dropdown__item.is-active {
  background: rgba(244,189,85,.12);
  color: #fff4cf;
}

.buddy-server-dropdown__item:active {
  transform: translateY(2px);
}

.buddy-server-dropdown__flag {
  width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 11px;
  background: rgba(255,255,255,.08);
  color: #f4bd55;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08);
  font-size: .9rem;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.buddy-server-dropdown__item.is-active .buddy-server-dropdown__flag {
  background: rgba(244,189,85,.18);
}

.buddy-server-dropdown__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buddy-server-dropdown__check {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(244,189,85,.18);
  color: #ffd88a;
  font-size: .82rem;
  font-weight: 950;
  opacity: 0;
}

.buddy-server-dropdown__item.is-active .buddy-server-dropdown__check {
  opacity: 1;
}

.auth-pin-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 20%, rgba(127,119,221,.24), transparent 34%),
    rgba(4,4,10,.72);
  backdrop-filter: blur(12px);
}

.auth-pin-modal.is-open {
  display: flex;
}

.auth-pin-card {
  position: relative;
  width: min(420px, 100%);
  border-radius: 28px;
  border: 4px solid #303045;
  background: linear-gradient(180deg, #1d1d31 0%, #141421 100%);
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,.06),
    inset 0 -6px 0 rgba(0,0,0,.24),
    0 24px 60px rgba(0,0,0,.48),
    0 0 44px rgba(127,119,221,.18);
  padding: 30px 24px 24px;
  text-align: center;
  animation: authPinPop .18s ease-out;
}

@keyframes authPinPop {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-pin-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.76);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.auth-pin-close:hover {
  background: rgba(255,255,255,.11);
  color: #fff;
}

.auth-pin-orb {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(250,199,117,.22), rgba(127,119,221,.18));
  border: 2px solid rgba(250,199,117,.35);
  font-size: 34px;
  box-shadow: 0 12px 28px rgba(0,0,0,.28), 0 0 22px rgba(250,199,117,.16);
}

.auth-pin-card h2 {
  margin: 0 0 8px;
  color: var(--amber-200);
  font-family: var(--font-pixel);
  font-size: .92rem;
  line-height: 1.5;
  text-shadow: 2px 2px 0 var(--amber-600);
}

.auth-pin-card p {
  margin: 0 0 20px;
  color: rgba(255,255,255,.68);
  font-weight: 800;
}

.auth-pin-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.auth-pin-form--hidden {
  display: none;
}

.auth-pin-form label {
  color: #f4bd55;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0,0,0,.5);
}

.auth-pin-form input {
  width: 100%;
  border: 3px solid #303045;
  border-radius: 18px;
  background: #10101c;
  color: #fff;
  outline: 0;
  padding: 14px 16px;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.04), inset 0 -4px 0 rgba(0,0,0,.20);
}

.auth-pin-form input:focus {
  border-color: rgba(250,199,117,.78);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.04), 0 0 0 4px rgba(250,199,117,.12);
}

.auth-pin-form .btn-primary {
  width: 100%;
  margin-top: 2rem;
  padding: 13px 18px;
}

.auth-pin-form .btn-primary.is-loading {
  pointer-events: none;
  opacity: .65;
}

.auth-pin-back {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.62);
  font-weight: 900;
  padding: 6px;
}

.auth-pin-back:hover {
  color: var(--amber-200);
}

.auth-pin-message {
  margin-top: 14px;
  color: rgba(255,255,255,.70);
  font-size: .9rem;
  font-weight: 800;
  text-align: center;
}

.auth-pin-message:empty {
  display: none;
}

.auth-pin-message.is-error {
  color: #ff9f9f;
}

.auth-pin-message.is-success {
  color: #9FE1CB;
}

@media (max-width: 560px) {
  .buddy-name-box {
    height: auto;
    min-height: 3.5rem;
    flex-wrap: wrap;
    overflow: hidden;
  }

  .buddy-name-box__label {
    min-height: 3.5rem;
  }

  .buddy-name-box__input {
    min-height: 3.5rem;
    font-size: 1.35rem;
  }

  .buddy-name-box__signin {
    width: 100%;
    min-height: 3rem;
    border-left: 0;
    border-top: 3px solid #303045;
    border-radius: 0 0 20px 20px;
  }

  .buddy-server-box {
    height: 3.25rem;
    margin-top: -8px;
    border-radius: 22px;
  }

  .buddy-server-box__label {
    font-size: .88rem;
    letter-spacing: .12em;
  }

  .buddy-server-box__select {
    font-size: 1rem;
    padding-left: .8rem;
  }
}
/* Sleep toggle state */
.action-btn[data-action="sleep"].is-sleeping {
  background: linear-gradient(135deg, rgba(127,119,221,0.36), rgba(34,211,238,0.24));
  border-color: rgba(191,219,254,0.72);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14) inset, 0 10px 28px rgba(79,70,229,0.24);
}

.action-btn[data-action="sleep"].is-sleeping .a-cost {
  color: #bfdbfe;
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* Sleep lock + modal */
.action-btn.is-sleep-locked,
.earn-btn.is-sleep-locked {
  opacity: 0.42;
  filter: grayscale(0.55);
  cursor: not-allowed;
  transform: none !important;
}

.action-btn.is-sleep-locked:hover,
.earn-btn.is-sleep-locked:hover {
  background: rgba(255,255,255,0.08);
  filter: grayscale(0.55);
}

.shop-grid.is-sleep-locked .shop-card,
.shop-card.sleep-locked {
  opacity: 0.48;
  filter: grayscale(0.5);
  cursor: not-allowed;
  pointer-events: none;
}

.sleep-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at 50% 18%, rgba(191,219,254,0.24), transparent 34%),
    radial-gradient(circle at 20% 80%, rgba(127,119,221,0.28), transparent 28%),
    rgba(5, 10, 24, 0.76);
  backdrop-filter: blur(12px);
}

.sleep-modal.show { display: flex; }

.sleep-card {
  position: relative;
  width: min(430px, 100%);
  overflow: hidden;
  border: 1px solid rgba(219,234,254,0.44);
  border-radius: 28px;
  padding: 28px 24px 22px;
  text-align: center;
  color: #eef6ff;
  background:
    linear-gradient(180deg, rgba(26,34,74,0.96), rgba(10,15,35,0.98)),
    radial-gradient(circle at 50% 0%, rgba(147,197,253,0.36), transparent 40%);
  box-shadow:
    0 28px 80px rgba(0,0,0,0.48),
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 42px rgba(127,119,221,0.22);
}

.sleep-card::before {
  content: '';
  position: absolute;
  inset: -90px -80px auto auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(125,211,252,0.18);
  filter: blur(4px);
}

.sleep-orb {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  font-size: 42px;
  background: linear-gradient(135deg, rgba(147,197,253,0.24), rgba(167,139,250,0.22));
  box-shadow: 0 14px 34px rgba(59,130,246,0.24), 0 0 0 1px rgba(255,255,255,0.14) inset;
  animation: sleep-float 2.1s ease-in-out infinite;
}

.sleep-card h2 {
  position: relative;
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.sleep-card p {
  position: relative;
  margin: 0 auto 18px;
  max-width: 330px;
  color: rgba(226,232,240,0.78);
  font-size: 13px;
  line-height: 1.55;
}

.sleep-stars span {
  position: absolute;
  color: rgba(219,234,254,0.8);
  text-shadow: 0 0 14px rgba(147,197,253,0.8);
  animation: sleep-twinkle 1.6s ease-in-out infinite;
}
.sleep-stars span:nth-child(1) { left: 48px; top: 44px; }
.sleep-stars span:nth-child(2) { right: 54px; top: 58px; animation-delay: .35s; }
.sleep-stars span:nth-child(3) { right: 90px; bottom: 86px; animation-delay: .7s; }

.sleep-meter {
  position: relative;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
}

.sleep-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(241,245,249,0.86);
}

.sleep-meter-head strong {
  font-size: 12px;
  color: #fff;
}

.sleep-meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15,23,42,0.82);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

.sleep-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.22s linear;
}

.sleep-meter-fill.energy {
  background: linear-gradient(90deg, #818cf8, #60a5fa, #67e8f9);
  box-shadow: 0 0 12px rgba(96,165,250,0.58);
}

.sleep-meter-fill.hunger {
  background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a);
  box-shadow: 0 0 12px rgba(251,191,36,0.42);
}

.sleep-wake-btn {
  position: relative;
  width: 100%;
  margin-top: 14px;
  border-radius: 16px;
  padding: 13px 16px;
  font-size: 14px;
  box-shadow: 0 10px 0 rgba(30,64,175,0.42), 0 18px 34px rgba(37,99,235,0.25);
}

.sleep-wake-btn:active {
  transform: translateY(3px);
  box-shadow: 0 7px 0 rgba(30,64,175,0.42), 0 12px 24px rgba(37,99,235,0.22);
}

@keyframes sleep-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

@keyframes sleep-twinkle {
  0%, 100% { transform: scale(.86); opacity: .42; }
  50% { transform: scale(1.25); opacity: 1; }
}

@media (max-width: 520px) {
  .sleep-card { padding: 24px 18px 18px; border-radius: 24px; }
  .sleep-orb { width: 74px; height: 74px; font-size: 36px; }
  .sleep-card h2 { font-size: 21px; }
}

/* ── Wordichi click stat floats ─────────────────────────────────────────── */
.stat-float {
  position: absolute;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(10, 15, 28, 0.72);
  box-shadow: 0 9px 22px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.16);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1;
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(0.88);
  animation: stat-float-pop 1.05s cubic-bezier(.18,.82,.22,1) forwards;
  backdrop-filter: blur(8px);
}
.stat-float-icon {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1;
}
.stat-float-value {
  transform: translateY(1px);
  text-shadow: 0 1px 3px rgba(0,0,0,0.55);
}
.stat-float-xp .stat-float-icon {
  font-family: var(--font-pixel);
  font-size: 7px;
  color: #fff7bf;
}
.stat-float-energy {
  background: linear-gradient(135deg, rgba(88,80,210,0.84), rgba(18,23,44,0.76));
}
.stat-float-happy {
  background: linear-gradient(135deg, rgba(239,159,39,0.9), rgba(75,43,15,0.74));
}
.stat-float-xp {
  background: linear-gradient(135deg, rgba(250,199,117,0.92), rgba(127,119,221,0.78));
}
@keyframes stat-float-pop {
  0% {
    opacity: 0;
    transform: translate3d(0, 10px, 0) scale(0.72);
  }
  16% {
    opacity: 1;
    transform: translate3d(var(--float-x), -4px, 0) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--float-x), -110px, 0) scale(1.12);
  }
}

/* ── Effect tooltips for actions/shop ───────────────────────────────────── */
.action-btn,
.shop-card {
  position: relative;
}

.action-btn[data-effect-tooltip],
.shop-card[data-effect-tooltip] {
  isolation: isolate;
}


.action-btn[data-effect-tooltip]:has(.effect-info:hover),
.action-btn[data-effect-tooltip]:has(.effect-info:focus-visible),
.shop-card[data-effect-tooltip]:has(.effect-info:hover),
.shop-card[data-effect-tooltip]:has(.effect-info:focus-visible) {
  z-index: 999;
}

.effect-info {
  position: absolute;
  z-index: 100000;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(250,199,117,0.58);
  background: linear-gradient(180deg, rgba(250,199,117,0.28), rgba(250,199,117,0.12));
  color: var(--amber-200);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.16);
  font-family: var(--font-pixel);
  line-height: 1;
  font-weight: 900;
  cursor: help;
  transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  right: 3px;
  top: 3px;
  height: 12px;
  width: 12px;
  font-size: .4rem;
  opacity: .4;
}
.shop-card .effect-info {
  right: 4px;
  top: 4px;
  opacity: .25;
}
/*.shop-card .effect-info {*/
/*  right: 12px;*/
/*  top: 10px;*/
/*  width: 20px;*/
/*  height: 20px;*/
/*  font-size: 9px;*/
/*}*/

.effect-info:hover,
.effect-info:focus-visible {
  opacity: 1;
  transform: translateY(-1px) scale(1.06);
  border-color: rgba(250,199,117,0.86);
  background: linear-gradient(180deg, rgba(250,199,117,0.42), rgba(250,199,117,0.18));
  outline: none;
}

.effect-tooltip {
  position: absolute;
  right: 0;
  top: 31px;
  transform: translateY(7px) scale(0.98);
  z-index: 999999;
  min-width: 218px;
  max-width: min(280px, 82vw);
  padding: 13px 14px 14px;
  border-radius: 16px;
  background: #24205a;
  border: 1px solid rgba(250,199,117,0.34);
  box-shadow: 0 18px 40px rgba(0,0,0,0.42), 0 0 22px rgba(127,119,221,0.26);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  font-family: var(--font-pixel);
  text-align: left;
  white-space: normal;
}

.shop-card .effect-tooltip {
  right: 8px;
  top: 36px;
}

.effect-tooltip::after {
  content: '';
  position: absolute;
  right: 10px;
  top: -6px;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #24205a;
  border-left: 1px solid rgba(250,199,117,0.28);
  border-top: 1px solid rgba(250,199,117,0.28);
}

.shop-card .effect-tooltip::after {
  right: 15px;
}

.effect-tooltip-title {
  display: block;
  margin-bottom: 10px;
  color: var(--amber-200);
  font-size: 8px;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.effect-tooltip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.effect-tooltip-row {
  display: grid;
  grid-template-columns: 28px 46px 1fr;
  align-items: center;
  column-gap: 8px;
  min-height: 28px;
  padding: 6px 8px;
  border-radius: 11px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
}

.effect-tooltip-row-note {
  grid-template-columns: 28px 1fr;
}

.effect-tooltip-icon {
  width: 28px;
  min-width: 28px;
  text-align: center;
  font-size: 20px;
  line-height: 1;
  font-family: 'Nunito', system-ui, sans-serif;
}

.effect-tooltip-value {
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
}

.effect-tooltip-label {
  min-width: 0;
  font-size: 8px;
  line-height: 1.45;
  color: rgba(255,255,255,0.9);
}

.effect-tooltip-row-good .effect-tooltip-value { color: #96f6c8; }
.effect-tooltip-row-bad .effect-tooltip-value { color: #ffb4b4; }
.effect-tooltip-row-note .effect-tooltip-label { grid-column: 2 / 4; color: rgba(255,255,255,0.82); }

.effect-info:hover + .effect-tooltip,
.effect-info:focus-visible + .effect-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 680px) {
  .effect-tooltip {
    right: 50%;
    top: 31px;
    transform: translate(50%, 7px) scale(0.98);
    min-width: 205px;
    max-width: min(245px, 86vw);
    padding: 12px;
  }

  .shop-card .effect-tooltip {
    right: 8px;
    transform: translateY(7px) scale(0.98);
  }

  .effect-tooltip::after {
    right: calc(50% - 6px);
  }

  .shop-card .effect-tooltip::after {
    right: 15px;
  }

  .effect-info:hover + .effect-tooltip,
  .effect-info:focus-visible + .effect-tooltip {
    transform: translate(50%, 0) scale(1);
  }

  .shop-card .effect-info:hover + .effect-tooltip,
  .shop-card .effect-info:focus-visible + .effect-tooltip {
    transform: translateY(0) scale(1);
  }

  .effect-tooltip-row {
    grid-template-columns: 26px 42px 1fr;
    column-gap: 7px;
  }

  .effect-tooltip-icon {
    width: 26px;
    min-width: 26px;
    font-size: 18px;
  }
}

/* ── Word rooms ─────────────────────────────────────────────────────────── */
.word-rooms-panel {
  border-color: rgba(127,119,221,0.22);
  background:
    radial-gradient(circle at 12% 0%, rgba(127,119,221,0.16), transparent 36%),
    var(--bg2);
}

.word-rooms-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.word-rooms-stats-group {
  display: flex;
  /*margin-bottom: 10px;*/
  gap: 3px;
  flex-wrap: wrap;
}

.word-rooms-stats-group.is-hidden {
  display: none !important;
}

.hidden {
  display: none !important;
}

.word-rooms-stats {
  display: flex;
  flex: 1;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  /*margin-top: 10px;*/
  /*margin-bottom: 10px;*/
  border: 0;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(
          90deg,
          rgba(127,119,221,0.12) 0%,
          rgba(127,119,221,0.075) 42%,
          rgba(127,119,221,0.035) 72%,
          rgba(127,119,221,0) 100%
  );
}

.word-rooms-stats-label {
  width: auto;
  min-width: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding-inline: 7px;
  color: rgba(255,255,255,0.62);
  background: none !important;
  padding-left: .7rem !important;
}

/*.word-rooms-stat-chip {*/
/*  min-width: 0;*/
/*  flex: 1 1 0;*/
/*  display: grid;*/
/*  align-content: center;*/
/*  gap: 3px;*/
/*  padding: 6px 4px;*/
/*  color: rgba(255,255,255,0.88);*/
/*  line-height: 1;*/
/*  text-align: center;*/
/*}*/

/*.word-rooms-stat-chip span {*/
/*  overflow: hidden;*/
/*  color: rgba(255,255,255,0.54);*/
/*  font-size: 9px;*/
/*  font-weight: 950;*/
/*  text-overflow: ellipsis;*/
/*  white-space: nowrap;*/
/*}*/

.word-rooms-stats strong {
  font-family: var(--font-pixel);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 0 rgba(0,0,0,0.2);
  line-height: 1;
}

.word-rooms-stats.is-games * {
  color: var(--amber-200);
}

.word-rooms-stats.is-wins * {
  color: var(--teal-100);
}

.word-rooms-stats.is-rate * {
  color: var(--purple-100);
}

.word-rooms-full-stats {
  cursor: pointer;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  border: 0;
  /*border-left: 1px solid rgba(255,255,255,0.06);*/
  border-radius: 0;
  /*background: rgba(0,0,0,0.11);*/
  background: none;
  color: rgba(250,199,117,0.86);
  font-family: var(--font-pixel);
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.12s ease, background 0.12s ease, transform 0.12s ease;
}

.word-rooms-full-stats-arrow {
  transform: translateY(-1px);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 1000;
  line-height: 0.7;
}

.word-rooms-full-stats:hover {
  background: rgba(250,199,117,0.08);
  color: var(--amber-200);
}

.word-rooms-full-stats:active {
  transform: translateY(1px);
}

.word-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.word-room-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.word-room-card:hover {
  transform: translateY(-2px);
  border-color: rgba(250,199,117,0.28);
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.045));
}

.word-room-card.is-locked,
.word-room-card.low-energy,
.word-room-card.sleep-locked {
  opacity: 0.55;
}

.word-room-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.word-room-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(250,199,117,0.26);
  background: linear-gradient(180deg, rgba(250,199,117,0.2), rgba(127,119,221,0.14));
  color: var(--amber-200);
  font-family: var(--font-pixel);
  font-size: 1.2rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.word-room-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.word-room-title strong {
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 900;
}

.word-room-title span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.word-room-rewards {
  display: grid;
  gap: 7px;
}

.word-room-effect-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  /*padding: 6px;*/
  border: 0;
  /*border-radius: 14px;*/
  border-radius: 14px 0 0 14px;
  background: rgba(255,255,255,0.04);
}

.word-room-effect-group.is-win {
  /*background: linear-gradient(90deg, rgba(34,197,94,0.1), rgba(255,255,255,0.035));*/
  background: linear-gradient(
          90deg,
          rgba(34,197,94,0.1) 0%,
          rgba(34,197,94,0.06) 45%,
          rgba(34,197,94,0.025) 70%,
          rgba(34,197,94,0) 100%
  );
}

.word-room-effect-group.is-cost {
  /*background: linear-gradient(90deg, rgba(248,113,113,0.1), rgba(255,255,255,0.035));*/
  background: linear-gradient(
          90deg,
          rgba(248,113,113,0.1) 0%,
          rgba(248,113,113,0.06) 45%,
          rgba(248,113,113,0.025) 70%,
          rgba(248,113,113,0) 100%
  );
  flex-wrap: nowrap;
}

.word-room-group-label {
  /*width: 36px;*/
  /*height: 100%;*/
  padding: 9px 6px;
  border-radius: 14px 0 0 14px;
  background: rgba(0,0,0,0.16);
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.06em;
}

.word-room-chip {
  /*flex: 1 1 0;*/
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 4px;
  /*border-radius: 999px;*/
  /*border: 1px solid rgba(255,255,255,0.09);*/
  /*background: rgba(255,255,255,0.07);*/
  color: rgba(255,255,255,0.88);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  /*box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);*/
}

.word-room-chip b {
  font-size: 9px;
  color: var(--amber-200);
}

.word-room-play {
  min-height: 34px;
  border: 1px solid rgba(250,199,117,0.32);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--amber-200), var(--amber-400));
  color: #412402;
  font-family: var(--font-pixel);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 0 var(--amber-600);
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.word-room-play:hover:not(:disabled) { filter: brightness(1.05); }
.word-room-play:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 var(--amber-600); }
.word-room-play:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.2);
}

.word-rooms-grid.is-sleep-locked .word-room-card { opacity: 0.48; }

@media (max-width: 680px) {
  .word-rooms-stats {
    gap: 4px;
    min-width: max-content;
  }

  /*.word-rooms-stats-label {*/
  /*  min-width: 42px;*/
  /*  padding-inline: 6px;*/
  /*  font-size: 8px;*/
  /*}*/

  /*.word-rooms-stat-chip {*/
  /*  padding: 6px 2px;*/
  /*}*/

  /*.word-rooms-stat-chip span {*/
  /*  font-size: 8px;*/
  /*}*/

  .word-rooms-stats strong {
    font-size: 0.68rem;
  }

  .word-rooms-full-stats {
    padding: .2rem;
    font-size: 6px;
    flex: 1;
    min-width: max-content;
  }

  .word-rooms-full-stats-arrow {
    font-size: 14px;
  }

  .word-rooms-grid { grid-template-columns: 1fr; }
  .word-room-card { padding: 11px; }
}



/* ── Newbie guide ───────────────────────────────────────────────────────── */
.newbie-guide {
  position: relative;
  overflow: hidden;
  gap: 18px;
  border-color: rgba(250,199,117,0.22);
  background:
    radial-gradient(circle at top right, rgba(250,199,117,0.16), transparent 30%),
    linear-gradient(180deg, rgba(250,199,117,0.08), rgba(127,119,221,0.08));
}

.newbie-guide.closed {
  cursor: pointer;
}

.newbie-guide[hidden] {
  display: none;
}
.newbie-guide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent 42%, rgba(255,255,255,0.02));
}
.newbie-guide > * { position: relative; z-index: 1; }
.newbie-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.newbie-guide-subtitle {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.newbie-guide-badge {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(250,199,117,0.28);
  background: rgba(250,199,117,0.12);
  color: var(--amber-200);
  font-family: var(--font-pixel);
  font-size: 8px;
  line-height: 1.6;
}
.newbie-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.newbie-point {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.95fr);
  gap: 14px;
  align-items: stretch;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(9, 12, 24, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.newbie-point.is-collapsed {
  display: flex;
}
.newbie-point.is-collapsed .newbie-point-copy {
  width: 100%;
}

.newbie-point-copy {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.newbie-point-copy-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.newbie-point-kicker {
  font-family: var(--font-pixel);
  font-size: 7px;
  line-height: 1.6;
  color: var(--amber-200);
}
.newbie-point h3 {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--text);
}
.newbie-point p {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255,255,255,0.84);
}
.newbie-point-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.newbie-point-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.newbie-point-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--amber-200), var(--amber-400));
  box-shadow: 0 0 10px rgba(250,199,117,0.35);
}
.newbie-point-visual {
  min-height: 180px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(12,17,31,0.92), rgba(20,25,44,0.96));
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}
.newbie-visual-stage {
  position: relative;
  min-height: 132px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.newbie-visual-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(127,119,221,0.35);
}
.newbie-visual-orbit.orbit-a { width: 88px; height: 88px; }
.newbie-visual-orbit.orbit-b { width: 126px; height: 126px; }
.newbie-visual-wordichi {
  position: relative;
  z-index: 2;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: linear-gradient(180deg, rgba(127,119,221,0.94), rgba(60,52,137,0.94));
  box-shadow: 0 12px 26px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.14);
  animation: newbieWordichiBounce 1.9s ease-in-out infinite;
}
.newbie-visual-xp {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  color: #fff1bf;
  border: 1px solid rgba(250,199,117,0.34);
  background: rgba(250,199,117,0.16);
  animation: newbieXPFly 1.9s ease-out infinite;
}
.newbie-visual-hand {
  position: absolute;
  right: 24px;
  bottom: 18px;
  width: 34px;
  height: 34px;
  animation: newbieHandTap 1.9s ease-out infinite;
}
.newbie-visual-hand::before {
  content: "👆";
  position: absolute;
  inset: 0;
  font-size: 30px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}
.newbie-visual-caption {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--amber-200);
}
.newbie-visual-stats {
  gap: 10px;
}
.newbie-stat-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.newbie-stat-card span {
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
}
.newbie-stat-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.newbie-stat-fill {
  height: 100%;
  border-radius: inherit;
  animation: newbieBarPulse 1.6s ease-in-out infinite;
}
.fill-health { width: 82%; background: linear-gradient(90deg, #ff7b7b, #E24B4A); }
.fill-hunger { width: 70%; background: linear-gradient(90deg, #34d399, #1D9E75); }
.fill-mood { width: 76%; background: linear-gradient(90deg, #f7c95f, #EF9F27); }
.fill-energy { width: 64%; background: linear-gradient(90deg, #9d97ff, #7F77DD); }
.newbie-visual-actions {
  align-items: flex-start;
}
.newbie-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  font-weight: 800;
}
.newbie-action-pill.rest {
  color: #fff0bf;
  border-color: rgba(250,199,117,0.28);
  background: rgba(250,199,117,0.12);
  animation: newbieRestGlow 1.7s ease-in-out infinite;
}
.newbie-rest-flow {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.newbie-rest-flow span {
  font-size: 12px;
  font-weight: 800;
}
.rest-plus { color: #a8b8ff; }
.rest-arrow { color: var(--text-muted); }
.rest-minus { color: #9fe1cb; }
.newbie-word-room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.92);
}
.newbie-word-reward {
  color: var(--amber-200);
  background: rgba(250,199,117,0.1);
  border: 1px solid rgba(250,199,117,0.22);
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 10px;
  animation: newbieRoomPulse 1.8s ease-in-out infinite;
}
.newbie-word-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}
.newbie-word-tile {
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  animation: newbieTileFlip 1.8s ease-in-out infinite;
}
.newbie-word-tile:nth-child(2) { animation-delay: 0.12s; }
.newbie-word-tile:nth-child(3) { animation-delay: 0.24s; }
.newbie-word-tile:nth-child(4) { animation-delay: 0.36s; }
.newbie-word-tile:nth-child(5) { animation-delay: 0.48s; }
.newbie-word-tile.hit { background: rgba(99,153,34,0.22); border-color: rgba(99,153,34,0.55); }
.newbie-word-tile.near { background: rgba(239,159,39,0.22); border-color: rgba(239,159,39,0.55); }
.newbie-word-tile.miss { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.newbie-word-room-btn {
  min-height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 900;
  font-size: 12px;
  color: white;
  background: linear-gradient(90deg, rgba(34,197,94,0.82), rgba(127,119,221,0.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
  animation: newbieRoomPulse 1.7s ease-in-out infinite;
  cursor: pointer;
}
.newbie-guide-summary {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(8,11,22,0.46);
}
.newbie-guide-summary-title {
  font-size: 14px;
  font-weight: 900;
  color: #fff0bf;
  margin-bottom: 10px;
}
.newbie-guide-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.newbie-chip {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
}
@keyframes newbieWordichiBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  20% { transform: translateY(-5px) scale(1.04); }
  45% { transform: translateY(0) scale(0.98); }
  68% { transform: translateY(-2px) scale(1.02); }
}
@keyframes newbieHandTap {
  0%, 18%, 100% { opacity: 0; transform: translate(18px, 16px) scale(0.9); }
  28%, 52% { opacity: 1; transform: translate(0, 0) scale(1); }
  62% { opacity: 0; transform: translate(8px, 8px) scale(0.94); }
}
@keyframes newbieXPFly {
  0%, 16% { opacity: 0; transform: translateY(6px) scale(0.86); }
  28%, 52% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-22px) scale(1.08); }
}
@keyframes newbieBarPulse {
  0%, 100% { filter: brightness(0.96); transform: scaleX(1); }
  50% { filter: brightness(1.14); transform: scaleX(1.02); }
}
@keyframes newbieRestGlow {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 0 rgba(250,199,117,0); }
  50% { transform: translateY(-1px); box-shadow: 0 0 18px rgba(250,199,117,0.18); }
}
@keyframes newbieRoomPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.03); filter: brightness(1.08); }
}
@keyframes newbieTileFlip {
  0%, 100% { transform: translateY(0) rotateX(0deg); }
  20% { transform: translateY(-2px) rotateX(0deg); }
  45% { transform: rotateX(90deg); }
  60% { transform: rotateX(0deg) translateY(-1px); }
}
@media (max-width: 860px) {
  .newbie-point {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .newbie-guide-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .newbie-point {
    padding: 12px;
  }
  .newbie-point-head-title {
    font-size: 16px;
  }
  .newbie-word-tiles {
    gap: 6px;
  }
  .newbie-word-tile {
    height: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .newbie-guide *, .newbie-guide *::before, .newbie-guide *::after {
    animation: none !important;
    transition: none !important;
  }
}


.newbie-point-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
}
.newbie-point-head-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.newbie-point-head-title {
  font-size: 18px;
  line-height: 1.25;
  font-weight: 900;
  color: var(--text);
}
.newbie-point-head-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.newbie-point-chevron {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  font-size: 16px;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.newbie-point.is-done .newbie-point-chevron {
  display: inline-flex;
}
.newbie-point-head.is-clickable { cursor: pointer; }
.newbie-point-head.is-clickable:hover .newbie-point-chevron {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}
.newbie-point-status {
  display: none;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 900;
  opacity: 0.8;
}
.newbie-point.is-done .newbie-point-status {
  display: inline-flex;
}
.newbie-point-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: transparent;
  transition: all 0.2s ease;
}
.newbie-point.is-done {
  border-color: rgba(34,197,94,0.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 0 0 1px rgba(34,197,94,0.08);
}
.newbie-point.is-done .newbie-point-status {
  color: #d7ffe7;
  border-color: rgba(34,197,94,0.28);
  background: rgba(34,197,94,0.14);
}
.newbie-point.is-done .newbie-point-check {
  color: white;
  border-color: rgba(34,197,94,0.45);
  background: linear-gradient(180deg, rgba(34,197,94,0.95), rgba(22,163,74,0.95));
  box-shadow: 0 0 14px rgba(34,197,94,0.25);
}
.newbie-point.is-done .newbie-point-kicker {
  color: #e8ffad;
}
@media (max-width: 560px) {
  .newbie-point-head {
    flex-direction: column;
    align-items: flex-start;
  }
}


.newbie-point.is-collapsed .newbie-point-copy-body,
.newbie-point.is-collapsed .newbie-point-visual {
  display: none;
}
.newbie-point.is-collapsed {
  align-items: center;
}
.newbie-point.is-collapsed .newbie-point-copy {
  gap: 0;
}
.newbie-point.is-collapsed .newbie-point-chevron {
  transform: rotate(180deg);
}
.newbie-point.is-done .newbie-point-head-title {
  color: #f3f6ff;
}


.newbie-point.is-collapsed .newbie-point-head-main {
  gap: 0;
}
.newbie-point.is-collapsed .newbie-point-kicker {
  display: none;
}
.newbie-point.is-collapsed .newbie-point-head-title {
  font-size: 16px;
}
.newbie-point.is-collapsed .newbie-point-head-side {
  margin-left: auto;
}

/* ── Solo room shell ─────────────────────────────────────────────────────── */
.solo-room-layout .device {
  /* Keep the Wordichi panel exactly on the same component/styles as game.html. */
}

.solo-room-panel {
  min-height: 520px;
}

.solo-todo-card {
  min-height: 520px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.solo-todo-text {
  color: var(--text-muted);
  font-weight: 800;
}

* {
  -webkit-tap-highlight-color: transparent;
}

.stat-row.stat-zero .stat-icon,
.stat-bg.stat-zero,
.stat-val.stat-zero {
  /*animation: stat-zero-blink 0.75s steps(2, end) infinite;*/
  animation: statZeroPulse 2.4s ease-in-out infinite;
}

/*.stat-zero {*/
/*  animation: statZeroPulse 2.4s ease-in-out infinite;*/
/*}*/

@keyframes statZeroPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.65;
    transform: scale(1.03);
    /*filter: drop-shadow(0 0 4px rgba(255, 90, 90, 0.45));*/
  }
}

.stat-bg.stat-zero {
  border-color: rgba(255, 74, 74, 0.9);
  box-shadow: 0 0 8px rgba(255, 74, 74, 0.55), inset 0 0 8px rgba(255, 74, 74, 0.16);
}

.stat-val.stat-zero {
  color: #fff;
  text-shadow: 0 0 5px rgba(255, 74, 74, 0.95), 0 1px 2px rgba(0,0,0,0.9);
}

.action-btn.is-hunger-locked {
  opacity: 0.56;
  cursor: not-allowed;
  filter: grayscale(0.45);
}

@keyframes stat-zero-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}


/* Header server select */
.header-server-select {
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
  width: max-content;
  min-width: 0;
  max-width: none;
}

.header-server-button {
  width: auto;
  min-width: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 15px 0 18px;
  /*border: 1px solid var(--border);*/
  border: none;
  border-radius: 16px;
  /*background:*/
  /*  linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.025)),*/
  /*  rgba(23, 23, 38, .94);*/
  background: none;
  color: #FAC775;
  /*box-shadow: 0 5px 0 rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.12);*/
  text-align: center;
  cursor: pointer;
}

.header-server-button:hover,
.header-server-select.is-open .header-server-button {
  border-color: rgba(250, 199, 117, .7);
  background:
    linear-gradient(180deg, rgba(250,199,117,.13), rgba(255,255,255,.035)),
    rgba(23, 23, 38, .96);
}

.header-server-title {
  min-width: 0;
  flex: 0 0 auto;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.header-server-chevron {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0;
  transform-origin: 50% 50%;
  transition: transform .14s ease;
}

.header-server-chevron::before {
  content: '';
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--amber-200);
  border-bottom: 2px solid var(--amber-200);
  transform: rotate(45deg) translate(-1px, -1px);
}

.header-server-select.is-open .header-server-chevron { transform: rotate(180deg); }

.header-server-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 180;
  width: min(320px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 90px));
  overflow-y: auto;
  display: none;
  padding: 8px;
  border: 1px solid rgba(250, 199, 117, .28);
  border-radius: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(250,199,117,.16), transparent 34%),
    linear-gradient(180deg, rgba(31,31,50,.98), rgba(14,14,26,.98));
  box-shadow: 0 24px 70px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.1);
}

.header-server-select.is-open .header-server-menu { display: grid; gap: 7px; }

.header-server-menu::-webkit-scrollbar { width: 8px; }
.header-server-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; }

.header-server-item {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  text-align: left;
  box-shadow: 0 4px 0 rgba(0,0,0,.16);
  cursor: pointer;
}

.header-server-item:hover {
  border-color: rgba(250,199,117,.42);
  background: rgba(250,199,117,.1);
  transform: translateY(-1px);
}

.header-server-item.is-active {
  border-color: rgba(250,199,117,.6);
  background: linear-gradient(90deg, rgba(250,199,117,.16), rgba(255,255,255,.055));
}

.header-server-item.is-empty { opacity: .72; }

.header-server-item-skin {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: radial-gradient(circle at 35% 20%, rgba(255,255,255,.2), rgba(250,199,117,.12) 42%, rgba(0,0,0,.16));
  border: 1px solid rgba(255,255,255,.13);
  font-size: 19px;
  font-weight: 900;
}

.header-server-item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.header-server-item-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 900;
}

.header-server-item-main small {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.header-server-item-go,
.header-server-item-empty {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,.08);
  color: var(--amber-200);
  font-weight: 900;
}

.header-server-item-go span{
  font-size: 20px;
  line-height: 20px;
}

.header-server-item-empty { font-size: 15px; color: var(--text-muted); }

@media (max-width: 680px) {
  .topbar-game .topbar-nav {
    display: flex;
    padding-left: 0;
    flex: 0 0 auto;
    justify-content: center;
  }

  .header-server-button {
    height: 36px;
    padding: 0 12px 0 14px;
    border-radius: 14px;
  }

  .header-server-title {
    max-width: 135px;
    font-size: 13px;
  }

  .header-server-menu { position: fixed; left: 50%; transform: translateX(-50%); }
}

/* Viewport-safe effect tooltip: rendered as a fixed body-level popup from game.js.
   This avoids clipping by mobile/desktop containers, overflow, transforms, and screen edges. */
.action-btn > .effect-tooltip:not(.effect-tooltip-floating),
.shop-card > .effect-tooltip:not(.effect-tooltip-floating) {
  display: none !important;
}

.effect-tooltip-floating {
  position: fixed !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 2147483000 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
  transform: none !important;
  width: max-content;
  min-width: min(218px, calc(100vw - 20px));
  max-width: calc(100vw - 20px);
  box-sizing: border-box;
}

.effect-tooltip-floating::after {
  display: none !important;
}

.effect-tooltip-floating .effect-tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  transform: rotate(45deg);
  background: #24205a;
  border-left: 1px solid rgba(250,199,117,0.28);
  border-top: 1px solid rgba(250,199,117,0.28);
}

.effect-tooltip-floating[data-placement="bottom"] .effect-tooltip-arrow {
  top: -6px;
}

.effect-tooltip-floating[data-placement="top"] .effect-tooltip-arrow {
  bottom: -6px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(250,199,117,0.28);
  border-bottom: 1px solid rgba(250,199,117,0.28);
}

@media (max-width: 680px) {
  .effect-tooltip-floating {
    min-width: min(205px, calc(100vw - 20px));
    max-width: calc(100vw - 20px);
    transform: none !important;
  }

  .effect-tooltip-floating .effect-tooltip-row {
    grid-template-columns: 26px 42px minmax(0, 1fr);
  }
}

/* Stable viewport tooltip behaviour.
   The floating tooltip must not steal hover/touch from the tiny info button,
   otherwise desktop hover can flicker and mobile tap can instantly close it. */
.effect-tooltip-floating {
  pointer-events: none !important;
  transition: none !important;
}

.effect-info {
  -webkit-tap-highlight-color: transparent;
}

.word-room-effect-label-group {
  display: flex;
}

.custom-emoji {
  margin-right: 2.5px;
  width: 1rem;
  /*height: 19px;*/
}

.coins-badge .custom-emoji {
  width: 1rem;
}
.word-room-chip .custom-emoji {
  width: 11px;
  transform: translateY(-.5px);
}
.is-cost .word-room-chip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}
.a-cost .custom-emoji {
  width: 8px;
  transform: translateY(1px);
  margin-right: 2px;
  margin-top: 1px;
  /*position: relative;*/
  /*top: 1px;*/
}

/*@font-face {*/
/*  font-family: "WordichiCoin";*/
/*  src: url("/static/fonts/wordichi-coin.woff2") format("woff2");*/
/*  font-style: normal;*/
/*  font-weight: 400;*/
/*  font-display: block;*/
/*}*/

/*.coin-icon {*/
/*  font-family: "WordichiCoin" !important;*/
/*  font-style: normal;*/
/*  font-weight: 400;*/
/*  line-height: 1;*/
/*  display: inline-block;*/
/*}*/

.wordichi-top-full-link {
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--amber-200);
}

/* Word room game type tabs */
.word-room-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  margin: 12px 0 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  background: rgba(17, 12, 31, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.word-room-type-btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  /*background: transparent;*/
  color: rgba(238, 232, 255, .72);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
  -webkit-tap-highlight-color: transparent;
  /*background: rgba(255, 255, 255, .06);*/
  background: rgb(89 122 183 / 23%);
}

.word-room-type-btn:hover {
  color: #fff;
  /*background: rgba(255, 255, 255, .08);*/
  background: rgb(89 122 183 / 33%);
}

.word-room-type-btn:active {
  transform: translateY(1px);
}

.word-room-type-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(127, 119, 221, .95), rgba(202, 92, 255, .92));
  box-shadow: 0 8px 18px rgba(91, 61, 203, .26), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.word-room-type-btn img {
  border-radius: 10px;
  height: 100px;
}
.word-room-type-btn span {
  font-size: 2.2rem;
}


.word-room-type-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .09);
  font-size: 12px;
  line-height: 1;
}

.word-room-type-btn.is-active .word-room-type-icon {
  background: rgba(255, 255, 255, .18);
}

@media (max-width: 520px) {
  .word-room-type-tabs {
    margin-top: 10px;
  }

  .word-room-type-btn {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 12px;
  }
}

/* Crossword room type / difficulty tabs */
.crossword-room-type-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  margin: -3px 0 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(9, 7, 18, .42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.crossword-room-type-tabs.is-hidden {
  display: none !important;
}

.crossword-room-type-btn {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 7px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(238, 232, 255, .66);
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
  -webkit-tap-highlight-color: transparent;
}

.crossword-room-type-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, .055);
}

.crossword-room-type-btn:active {
  transform: translateY(1px);
}

.crossword-room-type-btn.is-active {
  color: #fff;
  background: linear-gradient(135deg, rgba(250, 199, 117, .24), rgba(127, 119, 221, .34));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13);
}

.crossword-room-type-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  /*border-radius: 6px;*/
  /*background: rgba(255, 255, 255, .08);*/
  color: var(--amber-200);
  font-size: 1rem;
  line-height: 1;
}

/*.crossword-room-type-btn.is-active .crossword-room-type-icon {*/
/*  background: rgba(255, 255, 255, .14);*/
/*}*/

@media (max-width: 520px) {
  .word-room-type-btn span {
    font-size: 2rem;
  }
  .crossword-room-type-tabs {
    gap: 4px;
  }

  .crossword-room-type-btn {
    gap: 4px;
    min-height: 31px;
    padding: 7px 4px;
    /*font-size: 10px;*/
  }
}

.word-mines-room-type-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.word-mines-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.word-mines-mode-btn span {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .word-mines-mode-btn:not(.is-active) .word-mines-mode-size {
    display: none;
  }
}
