@import "tailwindcss";

:root {
  --ink: #11233f;
  --muted: #6d7890;
  --paper: #f7fbff;
  --blue: #0a6fd6;
  --deep-blue: #073f9b;
  --navy: #031936;
  --cyan: #26c5ee;
  --yellow: #ffd54a;
  --green: #27c679;
  --red: #ef5263;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #170b27;
  color: var(--ink);
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;
}

body {
  min-height: 100dvh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-user-select: none;
  user-select: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.app-shell {
  --shell-start: #a85cde;
  --shell-middle: #7541c3;
  --shell-bottom: #4d2589;
  --shell-glow: rgba(230,174,255,.34);
  --shell-action: rgba(77,37,137,.97);
  position: relative;
  width: 100%;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(165deg, var(--shell-start) 0%, var(--shell-middle) 42%, var(--shell-bottom) 100%);
  box-shadow: 0 0 80px rgba(0, 0, 0, .48);
}

.app-shell::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  max-width: 540px;
  margin: auto;
  background:
    linear-gradient(180deg, rgba(36, 13, 59, .12), transparent 25%),
    radial-gradient(circle at 20% 10%, var(--shell-glow), transparent 24%);
  pointer-events: none;
}

.spiral-pattern {
  position: fixed;
  z-index: -1;
  inset: 0;
  width: min(100vw, 540px);
  height: 100dvh;
  margin: 0 auto;
  display: block;
  pointer-events: none;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  opacity: .24;
  filter: blur(50px);
  pointer-events: none;
}

.ambient-one {
  top: -90px;
  right: -110px;
  background: var(--shell-glow);
}

.ambient-two {
  bottom: -100px;
  left: -140px;
  background: var(--shell-bottom);
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: max(18px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  animation: screen-in .35s cubic-bezier(.2,.75,.2,1) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.top-actions,
.app-header,
.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pill,
.round-chip,
.word-total {
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(3, 38, 100, .32);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
}

.brand-mini {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 15px;
  color: var(--yellow);
  font-weight: 900;
  letter-spacing: -.08em;
}

.icon-button,
.play-top > button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 15px;
  background: rgba(0, 37, 99, .32);
  color: white;
  font-size: 1.35rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.settings-shortcut {
  position: absolute;
  z-index: 20;
  top: max(18px, env(safe-area-inset-top));
  right: 22px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.settings-shortcut img {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.settings-shortcut-home {
  right: auto;
  left: 22px;
}

.back-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.back-button img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.back-button:focus-visible {
  border-radius: 10px;
}

.settings-screen .section-lead {
  margin-bottom: 22px;
}

.settings-list {
  display: grid;
  gap: 16px;
}

.settings-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(3,35,93,.32));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.17), 0 16px 30px rgba(0,16,56,.16);
}

.settings-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: rgba(255,222,68,.14);
  color: var(--yellow);
  font-size: 1.55rem;
  font-weight: 900;
}

.settings-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-copy b {
  color: white;
  font-size: 1rem;
}

.settings-copy small {
  color: rgba(255,255,255,.7);
  line-height: 1.35;
}

.timer-setting-value {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--yellow);
  font-size: 1.55rem;
  font-weight: 1000;
  line-height: 1;
}

.timer-setting-value small {
  font-size: .7rem;
}

.timer-setting-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

.timer-setting-control button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 13px;
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 1.35rem;
  font-weight: 1000;
  cursor: pointer;
}

.timer-setting-control input {
  width: 100%;
  height: 32px;
  margin: 0;
  accent-color: var(--yellow);
  cursor: pointer;
}

.timer-setting-control button:disabled,
.timer-setting-control input:disabled {
  cursor: not-allowed;
}

.timer-settings-card.locked .timer-setting-control {
  opacity: .42;
}

.sound-toggle {
  display: grid;
  grid-template-columns: 44px;
  gap: 6px;
  justify-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.68);
  cursor: pointer;
}

.sound-toggle span {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: rgba(255,255,255,.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
  transition: background .2s ease;
}

.sound-toggle span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform .2s ease, background .2s ease;
}

.sound-toggle.active {
  color: var(--yellow);
}

.sound-toggle.active span {
  background: var(--yellow);
}

.sound-toggle.active span::after {
  background: #14386c;
  transform: translateX(18px);
}

.sound-toggle em {
  font-size: .68rem;
  font-style: normal;
  font-weight: 900;
}

.settings-danger {
  display: block;
}

.settings-danger-title {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.settings-danger .settings-icon {
  background: rgba(255,105,105,.14);
  color: #ff9b9b;
}

.cancel-game-button {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border: 1px solid rgba(255,132,132,.58);
  border-radius: 15px;
  background: rgba(172,28,56,.24);
  color: #ffd7d7;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.cancel-game-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.cancel-confirmation {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255,132,132,.4);
  border-radius: 16px;
  background: rgba(89,10,35,.24);
}

.cancel-confirmation p {
  margin: 0 0 12px;
  color: white;
  font-size: .85rem;
  line-height: 1.4;
}

.cancel-confirmation > div {
  display: grid;
  gap: 9px;
}

.confirm-cancel-button,
.keep-game-button {
  min-height: 44px;
  border-radius: 13px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.confirm-cancel-button {
  border: 0;
  background: #ff7180;
  color: #4d0718;
}

.keep-game-button {
  border: 1px solid rgba(255,255,255,.24);
  background: transparent;
  color: white;
}

.no-active-game {
  display: block;
  margin-top: 10px;
  color: rgba(255,255,255,.58);
  text-align: center;
}

.hero-copy {
  margin: clamp(48px, 9vh, 88px) 0 38px;
  color: white;
  text-align: center;
}

.kicker,
.eyebrow {
  margin: 0;
  color: var(--yellow);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.logo {
  width: min(100%, 606px);
  margin: 8px auto 14px;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-copy > p:last-child {
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  line-height: 1.5;
}

.mode-list {
  display: grid;
  gap: 12px;
}

.mode-card {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 23px;
  color: white;
  text-align: left;
}

.mode-card.active {
  border: 2px solid white;
  background: white;
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 27, 88, .28);
  cursor: pointer;
}

.mode-card.active:active {
  transform: scale(.985);
}

.mode-card.disabled {
  background: rgba(3, 44, 108, .34);
  color: rgba(255,255,255,.64);
}

.mode-number {
  color: #0f72ce;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
}

.disabled .mode-number {
  color: rgba(255,255,255,.45);
}

.mode-card b,
.mode-card small {
  display: block;
}

.mode-card b {
  font-size: 1.2rem;
  letter-spacing: -.03em;
}

.mode-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: .76rem;
}

.mode-card.disabled small {
  color: rgba(255,255,255,.45);
}

.mode-card strong {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #143764;
  font-size: 1.35rem;
}

.mode-card em {
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  font-size: .65rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.home-next {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 0;
  padding: 9px 10px 9px 21px;
  border: 2px solid white;
  border-radius: 19px;
  background: var(--yellow);
  color: #16325b;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 23, 72, .28), inset 0 -3px 0 rgba(183, 126, 0, .2);
}

.home-next b {
  display: block;
  width: 48px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 0;
  background: transparent;
}

.home-next b img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-next:active {
  transform: translateY(2px);
}

.home-note {
  margin: 22px 0 0;
  color: rgba(255,255,255,.58);
  font-size: .76rem;
  text-align: center;
}

.app-header {
  min-height: 62px;
  color: white;
  text-align: center;
}

.app-header > div {
  flex: 1;
  padding: 0 8px;
}

.app-header h1 {
  margin: 3px 0 0;
  font-size: clamp(1.35rem, 5vw, 1.7rem);
  letter-spacing: -.04em;
  line-height: 1.08;
}

.header-spacer {
  width: 44px;
}

.content-screen {
  padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

.packs-screen {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.packs-screen .app-header,
.packs-screen .intro-row,
.packs-screen .sticky-action {
  flex: none;
}

.packs-screen .pack-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 3px 18px;
}

.packs-screen .pack-grid::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 17px;
  color: white;
}

.intro-row p {
  max-width: 240px;
  margin: 0;
  color: rgba(255,255,255,.74);
  font-size: .86rem;
  line-height: 1.4;
}

.word-total {
  flex: none;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 900;
}

.pack-grid {
  display: grid;
  gap: 11px;
}

.pack-card {
  position: relative;
}

.pack-card > button:first-child,
.add-pack-card {
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 54px 1fr 36px;
  gap: 13px;
  align-items: center;
  padding: 13px 14px;
  border: 2px solid transparent;
  border-radius: 21px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 37, 92, .15);
}

.pack-card > button:first-child {
  min-height: 96px;
  padding-bottom: 13px;
}

.pack-copy {
  min-width: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: max(0px, calc(var(--pack-group-top, 17px) - 13px)) 0 0;
}

.pack-card .pack-copy b {
  display: flex;
  align-items: flex-end;
  line-height: 1.15;
}

.pack-card.selected > button:first-child {
  border-color: var(--yellow);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 213, 74, .18), 0 12px 28px rgba(0, 35, 94, .2);
}

.pack-emoji {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: #e6f5ff;
  font-size: 1.75rem;
}

.pack-card b,
.pack-card small {
  display: block;
}

.pack-card b {
  font-size: 1.05rem;
}

.pack-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .76rem;
}

.pack-card i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 2px solid #c5d0dd;
  border-radius: 50%;
  color: #8190a3;
  font-style: normal;
  font-weight: 900;
}

.pack-card.selected i {
  border-color: #17a966;
  background: #17a966;
  color: white;
}

.pack-meta {
  position: absolute;
  z-index: 2;
  top: calc(var(--pack-group-top, 17px) + var(--pack-title-height, 2.3em) + 3px);
  left: 81px;
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
}

.pack-card .pack-meta small {
  margin: 0;
  line-height: 1rem;
}

.view-pack-words {
  position: static;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.view-pack-words span {
  font-size: 1rem;
  line-height: 1;
}

.view-pack-words:active {
  transform: translateY(1px);
}

.delete-pack {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--red);
  color: white;
  cursor: pointer;
}

.add-pack-card {
  grid-template-columns: 54px 1fr;
  grid-template-rows: auto auto;
  border: 2px dashed rgba(255,255,255,.44);
  background: rgba(3, 54, 119, .25);
  color: white;
  box-shadow: none;
}

.add-pack-card > span {
  grid-row: 1 / 3;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 17px;
  background: rgba(255,255,255,.12);
  font-size: 1.6rem;
}

.add-pack-card b {
  align-self: end;
  font-size: 1rem;
}

.add-pack-card small {
  align-self: start;
  color: rgba(255,255,255,.58);
  font-size: .72rem;
}

.sticky-action,
.bottom-action {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 540px);
  margin: auto;
  padding: 14px 22px max(17px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--shell-action) 28%);
}

.bottom-action {
  background: linear-gradient(180deg, transparent, var(--shell-action) 30%);
}

.primary-button {
  width: 100%;
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 10px 9px 21px;
  border: 0;
  border-radius: 19px;
  background: var(--yellow);
  color: #16325b;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 23, 72, .28), inset 0 -3px 0 rgba(183, 126, 0, .2);
}

.primary-button b {
  display: block;
  width: 48px;
  height: 41px;
  flex: 0 0 auto;
  background: transparent;
}

.primary-button b img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.primary-button:active:not(:disabled) {
  transform: translateY(2px);
}

.primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(.7);
  opacity: .55;
}

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 11, 35, .64);
  backdrop-filter: blur(5px);
}

.bottom-sheet {
  width: min(100%, 540px);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 9px 22px max(25px, env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: #f7fbff;
  box-shadow: 0 -22px 60px rgba(0,0,0,.3);
  animation: sheet-in .3s ease-out both;
}

@keyframes sheet-in {
  from { transform: translateY(30%); opacity: 0; }
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 2px auto 16px;
  border-radius: 10px;
  background: #c3ccda;
}

.sheet-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-title .eyebrow {
  color: #0870cf;
}

.sheet-title h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
}

.sheet-title .icon-button {
  border-color: #dce4ee;
  background: white;
  color: var(--ink);
}

.word-list-sheet {
  display: flex;
  max-height: 90dvh;
  flex-direction: column;
  overflow: hidden;
}

.word-list-title {
  display: grid;
  flex: none;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.word-list-title .pack-emoji {
  width: 52px;
  height: 52px;
}

.word-list-title h2 {
  overflow-wrap: anywhere;
  font-size: 1.15rem;
  line-height: 1.15;
}

.pack-word-list {
  counter-reset: pack-word;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  margin: 0 -4px;
  padding: 4px 4px max(8px, env(safe-area-inset-bottom));
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.pack-word-list li {
  counter-increment: pack-word;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid #dfe9f4;
  border-radius: 13px;
  background: white;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.pack-word-list li::before {
  content: counter(pack-word, decimal-leading-zero);
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: #e8f3ff;
  color: #0870cf;
  font-size: .62rem;
  font-weight: 1000;
}

.bottom-sheet label {
  display: block;
  margin: 12px 0;
  color: #44526a;
  font-size: .76rem;
  font-weight: 900;
}

.bottom-sheet input,
.bottom-sheet textarea {
  width: 100%;
  margin-top: 7px;
  padding: 14px 15px;
  border: 2px solid #dfe7f0;
  border-radius: 14px;
  background: white;
  color: var(--ink);
}

.bottom-sheet textarea {
  min-height: 110px;
  resize: vertical;
}

.secondary-button,
.sheet-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  background: #0d71cf;
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.sheet-button {
  background: #1c9b64;
}

.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 2px;
  color: #8b96a8;
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: #d7dfe9;
}

.form-error,
.balance-warning {
  padding: 9px 11px;
  border-radius: 11px;
  background: #ffe5e9;
  color: #af2742;
  font-size: .75rem;
  line-height: 1.35;
}

.centered-screen {
  display: flex;
  flex-direction: column;
}

.count-stage {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 13px;
  margin: auto 0 0;
}

.count-stage > button {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 20px;
  background: rgba(4, 48, 113, .32);
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

.count-stage > button:disabled {
  opacity: .32;
}

.big-count {
  min-height: 220px;
  display: grid;
  place-content: center;
  border: 2px solid rgba(255,255,255,.75);
  border-radius: 34px;
  background: rgba(255,255,255,.96);
  text-align: center;
  box-shadow: 0 22px 50px rgba(0, 32, 96, .25);
}

.big-count strong {
  color: #0a61bd;
  font-size: clamp(6.5rem, 27vw, 9rem);
  letter-spacing: -.1em;
  line-height: .8;
}

.big-count span {
  margin-top: 18px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.helper-text {
  margin: 22px 0 14px;
  color: rgba(255,255,255,.7);
  font-size: .78rem;
  text-align: center;
}

.dots-scale {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: auto;
}

.dots-scale i {
  width: 5px;
  height: 5px;
  border-radius: 10px;
  background: rgba(255,255,255,.3);
}

.dots-scale i.active {
  width: 24px;
  background: var(--yellow);
}

.section-lead {
  max-width: 390px;
  margin: 22px 0 16px;
  color: rgba(255,255,255,.74);
  font-size: .86rem;
  line-height: 1.45;
}

.section-lead.center {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.names-list {
  display: grid;
  gap: 9px;
}

.name-field {
  min-height: 60px;
  display: grid;
  grid-template-columns: 43px 1fr;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 17px;
  background: white;
  box-shadow: 0 8px 20px rgba(0, 35, 92, .14);
  overflow: hidden;
}

.name-field:focus-within {
  border-color: var(--yellow);
}

.name-field span {
  color: #1682d6;
  font-size: .72rem;
  font-weight: 1000;
  text-align: center;
}

.name-field input {
  height: 58px;
  min-width: 0;
  padding: 0 14px 0 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.team-count-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 11px;
  margin: auto 0 0;
}

.team-count-screen .helper-text {
  margin-bottom: auto;
}

.team-count-grid button {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 8px 18px;
  border: 2px solid transparent;
  border-radius: 24px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 35, 92, .16);
}

.team-count-grid button.selected {
  border-color: var(--yellow);
  background: white;
  box-shadow: 0 0 0 3px rgba(255,213,74,.18), 0 15px 32px rgba(0,33,88,.22);
}

.team-count-grid strong {
  color: #0871cd;
  font-size: 4rem;
  letter-spacing: -.08em;
  line-height: 1;
}

.team-count-grid span {
  font-weight: 1000;
}

.team-count-grid small {
  margin-top: 9px;
  color: var(--muted);
  font-size: .64rem;
  line-height: 1.3;
}

.team-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
}

.team-toolbar p {
  margin: 0;
  color: white;
  font-size: .83rem;
  font-weight: 900;
}

.team-toolbar button {
  flex: none;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 11px;
  background: rgba(2,47,108,.28);
  color: white;
  font-size: .72rem;
  font-weight: 900;
  cursor: pointer;
}

.unassigned-row {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 7px;
  color: rgba(255,255,255,.68);
  font-size: .74rem;
}

.unassigned-row button {
  flex: none;
  padding: 9px 12px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 900;
  cursor: pointer;
}

.unassigned-row button.active {
  border-color: var(--yellow);
  background: #fff9d9;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.team-panel {
  min-height: 154px;
  border-radius: 19px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 9px 22px rgba(0, 29, 82, .17);
  overflow: hidden;
}

.team-panel-title {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 29px 1fr 25px;
  align-items: center;
  padding: 7px 8px;
  border: 0;
  background: var(--team-color);
  color: #11315a;
  cursor: pointer;
}

.team-panel-title > span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.65);
  font-size: .7rem;
  font-weight: 1000;
}

.team-panel-title b {
  overflow: hidden;
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-panel-title i {
  font-style: normal;
  font-size: 1.1rem;
}

.team-members {
  display: grid;
  gap: 5px;
  padding: 8px;
}

.team-members button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #dce5ef;
  border-radius: 10px;
  background: white;
  color: var(--ink);
  font-size: .73rem;
  font-weight: 900;
  cursor: pointer;
}

.team-members button.active {
  border-color: var(--team-dark);
  background: color-mix(in srgb, var(--team-color) 18%, white);
}

.team-members small {
  padding: 7px 3px;
  color: #8b96a8;
  font-size: .64rem;
  line-height: 1.3;
  text-align: center;
}

.balance-warning {
  margin: 10px 0 0;
  text-align: center;
}

.rules-screen,
.turn-intro-screen {
  display: flex;
  flex-direction: column;
}

.round-progress {
  display: flex;
  gap: 6px;
  width: 150px;
  margin: 18px auto 0;
}

.round-progress i {
  height: 5px;
  flex: 1;
  border-radius: 10px;
  background: rgba(255,255,255,.26);
}

.round-progress i.done {
  background: var(--yellow);
}

.rule-card {
  margin: auto 0;
  padding: 28px 25px 24px;
  border-radius: 30px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 20px 50px rgba(0,27,86,.24);
  text-align: center;
}

.rule-icon {
  display: grid;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  place-items: center;
  border-radius: 25px;
  background: #e5f5ff;
  font-size: 2.4rem;
  transform: rotate(-3deg);
}

.rule-card .kicker {
  color: #0770cd;
}

.rule-card h2 {
  margin: 7px 0 14px;
  color: #0a54ad;
  font-size: clamp(2.3rem, 11vw, 3.7rem);
  letter-spacing: -.07em;
}

.rule-card > p:not(.kicker) {
  margin: 0;
  color: #56667d;
  font-family: Arial, sans-serif;
  font-size: .91rem;
  line-height: 1.6;
}

.rule-tip {
  display: grid;
  gap: 4px;
  margin-top: 21px;
  padding: 13px;
  border-radius: 14px;
  background: #edf7ff;
  color: #31516f;
  font-size: .72rem;
  line-height: 1.4;
}

.rule-tip b {
  color: #0a6fc9;
}

.round-chip {
  align-self: center;
  margin-top: 7px;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: .72rem;
  font-weight: 900;
}

.turn-card {
  position: relative;
  margin: auto 0 20px;
  padding: 30px 24px 27px;
  border-radius: 31px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 22px 52px rgba(0,30,90,.26);
  text-align: center;
}

.team-orbit {
  width: 86px;
  height: 86px;
  display: grid;
  margin: 0 auto 18px;
  place-items: center;
  border: 3px solid var(--team-color);
  border-radius: 50%;
  background: color-mix(in srgb, var(--team-color) 18%, white);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--team-color) 12%, transparent);
}

.team-orbit span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 17px;
  background: var(--team-color);
  color: #13375e;
  font-size: 1.25rem;
  font-weight: 1000;
}

.turn-card > p {
  margin: 0;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.turn-card h2 {
  margin: 4px 0 12px;
  color: var(--ink);
  font-size: clamp(2.6rem, 12vw, 4.1rem);
  letter-spacing: -.07em;
}

.team-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 12px;
  background: #eef4f9;
  color: #45566d;
  font-size: .76rem;
  font-weight: 900;
}

.team-line i,
.mini-team i,
.leader-row > i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--team-color);
}

.turn-card small {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: .76rem;
}

.turn-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 85px;
}

.turn-stats span {
  padding: 12px 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: rgba(3,47,112,.28);
  color: rgba(255,255,255,.7);
  font-size: .7rem;
  text-align: center;
}

.turn-stats b {
  color: white;
  font-size: .92rem;
}

.play-screen {
  display: flex;
  flex-direction: column;
  color: white;
}

.mini-team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(2,39,98,.28);
  font-size: .73rem;
  font-weight: 900;
}

.timer {
  position: relative;
  width: 225px;
  height: 225px;
  display: grid;
  margin: 20px auto 0;
  place-items: center;
  text-align: center;
}

.timer strong {
  position: relative;
  z-index: 1;
  font-size: 6.6rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.08em;
  line-height: 1;
}

.timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer circle {
  fill: none;
  stroke: rgba(255,255,255,.18);
  stroke-width: 6;
}

.timer circle.progress {
  stroke: var(--yellow);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 100;
  transition: stroke-dashoffset .8s linear;
}

.hurry .timer {
  color: #ffef78;
  animation: pulse .7s infinite alternate;
}

@keyframes pulse {
  to { transform: scale(1.05); }
}

.remaining {
  margin: 3px 0 18px;
  color: rgba(255,255,255,.65);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
}

.remaining span {
  display: inline-block;
  margin-right: 3px;
  color: white;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
  vertical-align: -.08em;
}

.word-card {
  min-height: 210px;
  display: grid;
  margin: auto 0;
  place-content: center;
  padding: 24px;
  border: 3px solid white;
  border-radius: 31px;
  background: white;
  color: var(--ink);
  box-shadow: 0 22px 55px rgba(0,25,75,.3);
  text-align: center;
}

.word-card > span {
  color: #1980ce;
  font-size: .7rem;
  font-weight: 1000;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.word-card h2 {
  max-width: 100%;
  margin: 12px 0 0;
  overflow-wrap: anywhere;
  font-size: clamp(2.35rem, 12vw, 4.2rem);
  letter-spacing: -.07em;
  line-height: .98;
}

.game-actions {
  --skip-action-size: clamp(96px, 27vw, 123px);
  --validation-action-size: clamp(192px, 54vw, 246px);
  display: grid;
  grid-template-columns: 1fr 2fr;
  width: calc(100% + 20px);
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  margin-left: -10px;
}

.game-actions button {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 25px;
  color: white;
  cursor: pointer;
  box-shadow: 0 11px 24px rgba(0,25,74,.24), inset 0 -4px 0 rgba(0,0,0,.13);
}

.game-actions button:active {
  transform: translateY(3px);
}

.game-actions b {
  font-size: 2.4rem;
  line-height: 1;
}

.game-actions span {
  font-size: .85rem;
  font-weight: 1000;
}

.game-actions .skip-button,
.game-actions .valid-button {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.skip-button img,
.valid-button img {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.skip-button img {
  width: var(--skip-action-size);
  height: var(--skip-action-size);
}

.valid-button img {
  width: var(--validation-action-size);
  height: var(--validation-action-size);
}

.results-screen {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.results-screen .app-header,
.results-screen .score-hero,
.results-screen .tap-hint,
.results-screen .sticky-action {
  flex: none;
}

.results-screen .attempt-list {
  flex: 1 1 auto;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 3px 12px;
}

.results-screen .attempt-list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.score-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 21px 0 15px;
  padding: 16px;
  border-radius: 19px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 24px rgba(0,35,92,.15);
}

.score-hero > span {
  color: #16a968;
  font-size: 2.6rem;
  font-weight: 1000;
  letter-spacing: -.08em;
}

.score-hero b,
.score-hero small {
  display: block;
}

.score-hero b {
  font-size: .95rem;
}

.score-hero small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
}

.attempt-list {
  display: grid;
  gap: 8px;
}

.attempt-list button {
  min-height: 52px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  border: 2px solid transparent;
  border-radius: 15px;
  background: white;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.attempt-list button.valid {
  border-color: rgba(30,192,116,.42);
}

.attempt-list button.missed {
  border-color: rgba(239,82,99,.42);
}

.attempt-list button > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  color: white;
  font-weight: 1000;
}

.attempt-list .valid > span {
  background: var(--green);
}

.attempt-list .missed > span {
  background: var(--red);
}

.attempt-list button b {
  font-size: .85rem;
}

.attempt-list button small {
  color: #8b96a8;
  font-size: .62rem;
}

.empty-result {
  padding: 30px 20px;
  border-radius: 17px;
  background: rgba(255,255,255,.9);
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
}

.tap-hint {
  margin: 12px 0 0;
  color: rgba(255,255,255,.66);
  font-size: .7rem;
  text-align: center;
}

.celebration {
  width: 78px;
  height: 78px;
  display: grid;
  margin: 32px auto 0;
  place-items: center;
  border-radius: 25px;
  background: var(--yellow);
  color: #0d5bb4;
  font-size: 2.7rem;
  box-shadow: 0 15px 30px rgba(0,33,91,.22);
  transform: rotate(5deg);
}

.leaderboard {
  display: grid;
  gap: 9px;
  margin-top: 22px;
}

.leader-row {
  min-height: 64px;
  display: grid;
  grid-template-columns: 31px 13px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 17px;
  background: white;
  box-shadow: 0 8px 20px rgba(0,35,92,.14);
}

.leader-row > span {
  color: #90a0b2;
  font-size: .74rem;
  font-weight: 1000;
}

.leader-row > b {
  font-size: .86rem;
}

.leader-row > strong {
  color: #0b65bd;
  font-size: 1.35rem;
}

.leader-row > strong small {
  font-size: .62rem;
}

.final-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  text-align: center;
}

.confetti {
  margin: 25px 0 18px;
  color: var(--yellow);
  font-size: 1.4rem;
  letter-spacing: .8em;
  transform: translateX(.4em);
}

.final-screen h1 {
  margin: 7px 0 21px;
  font-size: 3.4rem;
  letter-spacing: -.07em;
}

.winner-card {
  width: 100%;
  padding: 24px 20px;
  border: 3px solid white;
  border-radius: 29px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--team-color) 82%, white), var(--team-color));
  color: #153250;
  box-shadow: 0 20px 45px rgba(0,28,84,.28);
}

.winner-card > span {
  font-size: 3.6rem;
}

.winner-card p {
  margin: 8px 0 3px;
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.winner-card h2 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: -.05em;
}

.winner-card strong {
  display: block;
  margin-top: 8px;
  color: var(--team-dark);
}

.final-scores {
  width: 100%;
  display: grid;
  gap: 7px;
  margin: 14px 0 18px;
}

.final-scores > div {
  min-height: 45px;
  display: grid;
  grid-template-columns: 26px 10px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 13px;
  background: rgba(4,46,108,.36);
  color: white;
  text-align: left;
}

.final-scores span {
  color: rgba(255,255,255,.5);
  font-size: .68rem;
}

.final-scores i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.final-scores b {
  font-size: .76rem;
}

.round-breakdown {
  width: 100%;
  margin: 0 0 18px;
  padding: 13px 12px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 17px;
  background: rgba(4,46,108,.36);
  backdrop-filter: blur(10px);
}

.round-breakdown table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.round-breakdown caption {
  padding: 0 2px 12px;
  color: white;
  font-size: .88rem;
  font-weight: 1000;
  text-align: left;
}

.round-breakdown th,
.round-breakdown td {
  padding: 8px 4px;
}

.round-breakdown thead th {
  color: rgba(255,255,255,.58);
  font-size: .61rem;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.round-breakdown thead th:first-child,
.round-breakdown tbody th {
  width: 43%;
  text-align: left;
}

.round-breakdown tbody tr {
  border-top: 1px solid rgba(255,255,255,.11);
}

.round-breakdown tbody th {
  overflow: hidden;
  color: white;
  font-size: .7rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-breakdown tbody th i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--team-color);
}

.round-breakdown td {
  color: white;
  font-size: .76rem;
  font-weight: 900;
  text-align: center;
}

.round-breakdown td span {
  display: inline-grid;
  min-width: 28px;
  min-height: 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255,255,255,.1);
}

.round-breakdown .round-total {
  color: var(--yellow);
  font-size: .9rem;
}

.text-button {
  margin-top: 12px;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font-size: .76rem;
  font-weight: 900;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 430px) {
  .pack-word-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 541px) {
  .app-shell {
    min-height: calc(100dvh - 28px);
    margin: 14px auto;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 34px;
  }

  .screen {
    min-height: calc(100dvh - 28px);
  }

  .sticky-action,
  .bottom-action {
    bottom: 14px;
    border-radius: 0 0 34px 34px;
  }
}

@media (max-height: 700px) {
  .hero-copy {
    margin: 25px 0 22px;
  }

  .mode-card {
    min-height: 76px;
  }

  .big-count {
    min-height: 180px;
  }

  .rule-card {
    margin: 24px 0 90px;
  }

  .turn-card {
    margin-top: 24px;
  }

  .timer {
    width: 180px;
    height: 180px;
    margin-top: 8px;
  }

  .timer strong {
    font-size: 5.1rem;
  }

  .word-card {
    min-height: 170px;
  }

  .game-actions button {
    min-height: 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
