@import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;500;700;800;900&display=swap');

:root {
  --game-header-logo-height: 96px;
  --game-header-logo-gap: -18px;
  --game-ad-pull-up: 66px;
  --game-ad-side-gap: 86px;
  --game-width: 900px;
  --blue: #1597ed;
  --blue-dark: #0f79c5;
  --blue-soft: #eef8ff;
  --line: #d6e8f5;
  --green: #25b84a;
  --green-dark: #0f9d2d;
  --orange: #f2a019;
  --red: #ef5a62;
  --gold: #ffd84a;
  --silver: #d7dee6;
  --bronze: #e8a16c;
  --text: #203248;
  --muted: #6f8295;
  --card: #fff;
  --border: #d9eaf6;
  --shadow: 0 10px 28px rgba(20, 85, 140, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, #f7fbff 0%, #fff 60%);
  color: var(--text);
  font-family: "Arimo", Arial, sans-serif;
}

button, input { font: inherit; font-family: "Arimo", Arial, sans-serif; }

.hidden { display: none !important; }

.game-barmain-wrap {
  width: 100%;
  text-align: center;
  margin: 0;
  line-height: 0;
}

.game-barmain-wrap iframe {
  border: 0;
  display: block;
  width: 1350px;
  max-width: 100%;
  height: 120px;
  margin: 0 auto;
}

@media (max-width: 700px) {
  .game-barmain-wrap { display: none !important; }
  :root {
    --game-header-logo-gap: -6px;
  }
  body.is-finish-screen .game-header-logo {
    margin-bottom: var(--game-header-logo-gap);
  }
  body.is-play-screen #main_container {
    margin-top: 0;
  }
}

#main_container {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

.game-seo-footer {
  margin: 18px auto 28px;
  max-width: 760px;
  padding: 0 14px;
  text-align: center;
}

.game-seo-heading {
  margin: 0 0 12px;
  color: #1474c9;
  font-size: 22px;
  font-weight: 900;
}

.game-seo-text {
  text-align: center;
  color: #365c78;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.65;
}

.game-seo-text p {
  margin: 0 0 12px;
}

.game-seo-link-wrap {
  margin: 16px 0 0;
  text-align: center;
}

.game-seo-footer a {
  color: blue;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.more-versions {
  width: min(640px, 100%);
  margin: 48px auto 22px;
  text-align: center;
  padding: 0 8px;
}

.more-versions-title {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 900;
  color: #075fae;
  letter-spacing: -0.3px;
}

.related-games-strip {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.related-game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 2px solid #bfe4ff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 94, 180, 0.11);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.related-game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 94, 180, 0.16);
}

.related-game-info {
  min-height: 86px;
  padding: 12px 12px 0;
  text-align: center;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.85), transparent 30%),
    #f5fbff;
  order: 1;
}

.related-game-title {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 900;
  color: #075fae;
}

.related-game-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.28;
  font-weight: 700;
  color: #526d82;
}

.related-game-img-wrap {
  position: relative;
  padding: 0 0 10px;
  margin-top: -12px;
  background: #fff;
  order: 2;
}

.related-game-img {
  display: block;
  width: 92%;
  max-width: 235px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 14px rgba(0, 94, 180, 0.13);
}

body.is-game-active .more-versions,
body.is-game-active .game-seo-footer {
  display: none;
}

.game-header-logo {
  height: var(--game-header-logo-height);
  margin: 0 0 var(--game-header-logo-gap);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-align: center;
}

.game-header-logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.game-header-logo img {
  display: block;
  max-width: 300px;
  max-height: var(--game-header-logo-height);
  width: auto;
  height: auto;
  object-fit: contain;
}

body.is-play-screen .game-header-logo {
  height: 0;
  margin: 0;
  overflow: hidden;
}

body.is-play-screen .game-header-logo a {
  visibility: hidden;
  pointer-events: none;
}

body.is-play-screen #main_container {
  margin-top: 8px;
}

body.is-finish-screen .game-header-logo {
  margin-bottom: 0;
}

body.is-finish-screen #main_container {
  margin-top: -28px;
}

.game-layout {
  display: flex;
  flex-direction: row;
  direction: ltr;
  align-items: flex-start;
  justify-content: center;
  gap: var(--game-ad-side-gap);
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 12px;
}

.game-ad-left,
.game-ad-right {
  width: 160px;
  height: 600px;
  flex-shrink: 0;
  margin-top: calc(-1 * var(--game-ad-pull-up));
  align-self: flex-start;
  overflow: hidden;
}

.game-ad-left ins,
.game-ad-right ins {
  display: inline-block;
  width: 160px;
  height: 600px;
}

body.is-play-screen .game-ad-left,
body.is-play-screen .game-ad-right,
body.is-play-screen .game-center {
  margin-top: 0;
}

body.is-play-screen .app {
  margin-top: 0;
}

.game-center {
  width: 100%;
  max-width: var(--game-width);
  flex: 0 1 var(--game-width);
  direction: rtl;
}

.app {
  width: 100%;
  max-width: 760px;
  margin: 14px auto 28px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
}

/* home / start screen */
.start-screen .panel {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 20px;
}

.main-title {
  margin: 0 0 6px;
  text-align: center;
  color: #1474c9;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sub-title, .section-title {
  margin: 0 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 16px;
}

.section-title { color: var(--blue-dark); font-weight: 800; font-size: 1.35rem; margin-bottom: 14px; }

.start-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e7f0f8;
  border-radius: 18px;
  padding: 18px 16px 16px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #32506d;
}

.name-input {
  width: 100%;
  max-width: 270px;
  height: 42px;
  display: block;
  margin: 0 auto 10px;
  padding: 8px 14px;
  border: 2px solid #bfd8ea;
  border-radius: 14px;
  background: #fff;
  color: #143451;
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  outline: none;
  transition: .16s ease;
}

.name-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(33, 150, 243, .10);
}

.difficulty-title {
  margin: 0 0 10px;
  text-align: center;
  color: #32506d;
  font-size: 18px;
  font-weight: 700;
}

.start-card .settings-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: stretch;
  width: min(100%, 350px);
  margin: 0 auto;
}

.start-card .setting-box {
  flex: 1;
  min-width: 0;
  margin: 0;
  background: linear-gradient(180deg, #59d8ff, #1678f5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 6px 4px 8px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3), 0 6px 12px rgba(18, 108, 255, 0.14);
}

.start-card .setting-title {
  font-size: 0.72rem;
  line-height: 1.15;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
  text-align: center;
  text-shadow: 0 2px 0 rgba(39, 44, 130, 0.28);
}

.start-card .choice-row {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.start-card .setting-choice {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffefa, #fff4e7);
  color: #17366f;
  padding: 5px 8px;
  min-width: 28px;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 3px 0 rgba(207, 185, 162, 0.48), 0 7px 10px rgba(48, 31, 120, 0.09), inset 0 2px 0 #fff;
}

.start-card .setting-choice.selected {
  background: linear-gradient(180deg, #ffe843, #ffbd00);
  color: #17366f;
  box-shadow: 0 5px 0 rgba(204, 124, 0, 0.65), 0 10px 14px rgba(255, 174, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.65);
}

.start-btn {
  width: 100%;
  max-width: 210px;
  min-height: 46px;
  display: block;
  margin: 20px auto 30px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #2fd058, #1aab3d);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(18, 132, 50, .24), 0 10px 18px rgba(41, 168, 72, .18);
  transition: .16s ease;
}

.start-btn:hover { transform: translateY(-1px); }
.start-btn:active { transform: translateY(1px); }

.home-online-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 4px;
}

.home-join-btn,
.home-join-submit-btn {
  background: linear-gradient(180deg, #58c7ff, #1f92f1);
  box-shadow: 0 6px 0 rgba(21, 109, 188, .24), 0 10px 18px rgba(33, 150, 243, .18);
}

.start-note {
  margin: 12px 0 0;
  text-align: center;
  color: #8a9aab;
  font-size: 14px;
}

.home-actions {
  display: grid;
  gap: 10px;
  max-width: 320px;
  margin: 20px auto 0;
}

.join-code-box {
  display: flex;
  gap: 8px;
  max-width: 340px;
  margin: 12px auto 0;
  align-items: center;
}

.join-code-box input {
  flex: 1;
  height: 44px;
  border: 2px solid #bfd8ea;
  border-radius: 12px;
  padding: 0 12px;
  text-align: center;
  text-transform: uppercase;
}

.join-code-box .start-btn {
  max-width: none;
  width: auto;
  min-width: 110px;
  margin: 0;
  font-size: 17px;
  padding: 0 14px;
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(180deg, #24c545, #0b9e28);
  color: #fff;
  box-shadow: 0 5px 0 rgba(5, 119, 24, 0.18);
}

.btn.secondary {
  background: linear-gradient(180deg, #43b8f2, #1490de);
  color: #fff;
  box-shadow: 0 5px 0 rgba(14, 105, 170, 0.18);
}

.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.wide { width: 100%; }

/* lottery */
.lottery-panel {
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 8px 14px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.lottery-title {
  margin: 0 0 10px;
  text-align: center;
  color: #1577ce;
  font-size: 30px;
  font-weight: 900;
}

.lottery-stage {
  width: min(430px, 100%);
  margin: 0 auto 12px;
  position: relative;
}

.letter-frame {
  position: relative;
  width: 84%;
  max-width: 382px;
  height: 208px;
  margin: 0 auto;
  border-radius: 34px;
  background: linear-gradient(180deg, #fff 0%, #fff8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 0 rgba(205, 183, 163, 0.52),
    0 20px 30px rgba(35, 35, 125, 0.14),
    0 0 0 3px rgba(235, 240, 255, 0.8),
    inset 0 3px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 10px rgba(230, 220, 210, 0.28);
  overflow: hidden;
}

.letter-frame.rolling { animation: heroPulse 0.55s ease-in-out infinite alternate; }

@keyframes heroPulse {
  from { transform: scale(1); }
  to { transform: scale(1.012); }
}

.letter-value {
  position: relative;
  z-index: 2;
  color: #ffcf00;
  font-size: 160px;
  line-height: 1;
  font-weight: 900;
  text-shadow:
    0 7px 0 #c95500,
    0 11px 16px rgba(105, 45, 0, 0.24),
    0 2px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-12px);
}

.lottery-status {
  min-height: 32px;
  margin-top: 10px;
  text-align: center;
  color: #16608d;
  font-size: 1.35rem;
  font-weight: 900;
}

/* play */
.play-scoreboard {
  display: none !important;
}

.play-score-card {
  padding: 8px 6px;
  border: 1px solid #d8e9f6;
  border-radius: 13px;
  background: #fbfdff;
  text-align: center;
  min-width: 0;
}

.play-score-card.me {
  background: linear-gradient(180deg, #fff9df, #fff3bb);
  border-color: #f2d97a;
}

.play-score-card.submitted { opacity: 0.85; }

.play-score-card .name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #28506a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-score-card .score {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #0f7cc8;
}

.play-score-card .status {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.play-score-card.submitted .status { color: var(--green); }

.letter-box {
  width: 100%;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 2px solid #9fd4f7;
  border-radius: 18px;
  background: linear-gradient(135deg, #e7f6ff, #c8ebff);
  color: #114d74;
  font-size: 2.4rem;
  font-weight: 800;
  text-align: center;
}

.timer-track {
  width: 100%;
  height: 54px;
  position: relative;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid #efa73f;
  border-radius: 14px;
  background: #fff0d5;
}

.timer-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
  background: linear-gradient(90deg, #ff7b00, #ffb100);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  transition: width 1s linear;
}

.timer-icon { font-size: 1.2rem; line-height: 1; }

.round-line {
  text-align: center;
  margin-bottom: 12px;
  color: #155d8c;
  font-size: 1.1rem;
  font-weight: 800;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.category-card {
  min-width: 0;
  padding: 10px;
  border: 2px solid #d8eafa;
  border-radius: 15px;
  background: #f9fcff;
  transition: 0.16s ease;
}

.category-card:focus-within {
  border-color: #1599f1;
  background: #eef8ff;
  box-shadow: 0 5px 14px rgba(21, 153, 241, 0.12);
}

.category-card label {
  display: block;
  margin-bottom: 6px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #28506a;
}

.category-card input {
  width: 100%;
  height: 48px;
  padding: 8px 10px;
  border: 2px solid #9caab4;
  border-radius: 10px;
  background: #fff;
  color: #102b43;
  outline: none;
  text-align: center;
  font-size: 1.1rem;
}

.category-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 151, 237, 0.15);
}

.category-card input:disabled {
  opacity: 0.75;
  background: #f5f9fc;
}

.finish-btn {
  width: 100%;
  margin-top: 14px;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(180deg, #39c95a, #24aa44);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(8, 120, 29, 0.22);
}

.finish-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.grace-top-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translate3d(-50%, -140%, 0);
  z-index: 12000;
  max-width: min(92vw, 420px);
  width: max-content;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8e8, #ffefcc);
  border: 1px solid #f0d27a;
  color: #8a6400;
  font-weight: 800;
  font-size: 1.02rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(120, 80, 0, 0.18);
  transition: transform 0.28s ease, opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.grace-top-toast.show {
  transform: translate3d(-50%, 0, 0);
  opacity: 1;
}

.grace-top-toast strong {
  color: #a04e00;
  font-weight: 900;
}

.reconnect-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 11999;
  max-width: min(92vw, 420px);
  padding: 11px 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #e8f4ff, #d6ecff);
  border: 1px solid #9cccf0;
  color: #1a5f8f;
  font-weight: 800;
  font-size: 0.98rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(20, 90, 150, 0.16);
  transition: transform 0.28s ease, opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
}

.reconnect-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.host-away-banner {
  margin: 0 auto 10px;
  max-width: 520px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff6e8;
  border: 1px solid #f0d27a;
  color: #8a6400;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
}

.host-away-banner.hidden {
  display: none;
}

.grace-note {
  text-align: center;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff8e8;
  color: #8a6400;
  font-weight: 800;
  font-size: 1.05rem;
}

.grace-note #graceFinisherName {
  color: #a04e00;
  font-weight: 900;
}

.grace-note #graceSeconds,
.play-panel.grace-mode #timerNumber {
  display: inline-block;
  min-width: 1.4em;
  font-size: 1.35em;
  color: #c45f00;
}

.grace-note #graceSeconds.tick-pop,
.play-panel.grace-mode #timerNumber.tick-pop {
  animation: grace-tick-pop 0.45s ease;
}

.play-panel.grace-mode .timer-track {
  border-color: #e87820;
  background: #fff3e0;
}

.play-panel.grace-mode .timer-fill {
  background: linear-gradient(90deg, #ff5a00, #ffb100);
}

@keyframes grace-tick-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); color: #e94d00; }
  100% { transform: scale(1); }
}

.review-note {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid #cfe5f5;
  border-radius: 14px;
  background: #f5fbff;
  color: #35566e;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
}

.review-note strong {
  color: #155d8c;
  font-weight: 900;
}

.review-send-btn {
  display: block;
  margin: 4px auto 0;
  border: 0;
  background: none;
  color: #ef5a62;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  padding: 0;
  font-family: 'Arimo', Arial, sans-serif;
}

.review-send-btn:hover { text-decoration: underline; }

.review-send-btn:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}

/* voting */
.voting-sub {
  text-align: center;
  color: var(--muted);
  margin: -6px 0 14px;
  font-weight: 700;
}

.voting-list { display: grid; gap: 10px; }

.vote-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.vote-item-head { font-weight: 800; margin-bottom: 10px; color: #28506a; }

.vote-actions { display: flex; gap: 8px; }

.vote-actions button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.vote-actions .approve { background: #e8f9ed; color: #1a8a36; }
.vote-actions .reject { background: #fff0f1; color: #c62828; }
.vote-actions button.chosen { outline: 3px solid var(--blue); }

/* review — ee-multi */
.review-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.review-finish-actions {
  display: flex;
  align-items: stretch;
  gap: 9px;
  flex: 1 1 320px;
  min-width: 0;
  direction: rtl;
}

.review-finish-actions .action-btn,
.review-finish-actions .back-finish-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  font-size: 17px;
}

.next-round-btn {
  min-height: 48px;
  padding: 8px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #24c545, #0b9e28);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(5, 119, 24, 0.18);
}

.top-info { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3db6ff, #118fe9);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 5px 0 rgba(12, 112, 190, 0.18);
}

.scoreboard.players-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.compare-table.players-2 #head2,
.compare-table.players-2 thead th:nth-child(4),
.compare-table.players-2 tbody td:nth-child(4) {
  display: none;
}

.compare-table.players-2 {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.review-suggest-section {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid #f0d4d6;
  border-radius: 14px;
  background: #fff9f9;
  text-align: center;
}

.review-suggest-title {
  margin: 0 0 8px;
  color: #5a3d40;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.review-suggest-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.review-suggest-link {
  border: 0;
  background: none;
  color: #ef5a62;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 8px;
  font-family: 'Arimo', Arial, sans-serif;
  text-decoration: none;
}

.review-suggest-link .review-suggest-cat {
  text-decoration: underline;
}

.review-suggest-link .review-suggest-word {
  text-decoration: none;
}

.review-suggest-link:hover { color: #d63f48; }
.review-suggest-link:disabled {
  opacity: 0.45;
  cursor: default;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.score-card {
  padding: 9px 7px;
  border: 1px solid #d8e9f6;
  border-radius: 13px;
  background: #fbfdff;
  text-align: center;
  min-width: 0;
}

.score-card.first {
  background: linear-gradient(180deg, #fff9df, #fff3bb);
  border-color: #f2d97a;
}

.score-card .name {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  font-weight: 800;
  color: #28506a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.score-card .score {
  font-size: 18px;
  font-weight: 800;
  color: #0f7cc8;
}

.players-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 10px;
}

.switch-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #43b8f2, #1490de);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(14, 105, 170, 0.18);
}

.switch-btn:disabled { opacity: 0.35; cursor: default; }

.switch-label {
  min-width: 170px;
  text-align: center;
  color: #3c6078;
  font-size: 15px;
  font-weight: 700;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  padding: 7px 5px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.compare-table th:last-child,
.compare-table td:last-child { border-left: 0; }

.compare-table tr:last-child td { border-bottom: 0; }

.compare-table thead th {
  background: #e9f5fd;
  color: #244b66;
  font-size: 16px;
  font-weight: 800;
}

.category-head {
  width: 90px;
  background: #dff1fd !important;
}

.player-name {
  display: block;
  font-size: 17px;
  color: #155d8c;
  font-weight: 800;
}

.player-total {
  display: block;
  margin-top: 2px;
  color: #758a9a;
  font-size: 12px;
  font-weight: 700;
}

.category-cell {
  background: #f3faff;
  color: #23465e;
  font-size: 16px;
  font-weight: 800;
}

.answer-cell { background: #fff; }

.answer-box {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 9px;
  background: #f9fcff;
  font-size: 15px;
  font-weight: 700;
}

.answer-box.ok { border: 1px solid #bfe7c8; background: #f2fcf4; }
.answer-box.duplicate { border: 1px solid #ffd18b; background: #fff9ee; }
.answer-box.bad { border: 1px solid #f4c0c4; background: #fff4f5; }

.mark.ok { color: #27ad45; }
.mark.duplicate { color: #f09a13; }
.mark.bad { color: #e94d55; }

.points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 23px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.points.full { background: var(--green); }
.points.half { background: var(--orange); }
.points.zero { background: #d9e1e7; color: #617382; }

.legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  color: #60798d;
  font-size: 13px;
  font-weight: 700;
}

.legend-difficulty {
  margin-right: auto;
  color: #5a6b7a;
  font-weight: 700;
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.orange { background: var(--orange); }
.dot.red { background: var(--red); }

/* between rounds */
.between-panel {
  max-width: 400px;
  margin: 0 auto;
}

.between-title {
  margin: 0 0 6px;
  text-align: center;
  color: var(--blue-dark);
  font-size: 1.4rem;
  font-weight: 800;
}

.between-sub {
  margin: 0 0 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.between-actions {
  display: grid;
  gap: 8px;
}

.between-force-hint {
  margin: 10px 0 0;
  text-align: center;
  color: #8a6400;
  font-size: 13px;
  font-weight: 800;
}

.between-force-hint.hidden {
  display: none !important;
}

.status-player-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f4f7ff);
  border: 1px solid var(--line);
  font-weight: 800;
  color: #26365f;
  box-shadow: 0 4px 0 rgba(166, 185, 220, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.status-player-list li.done {
  color: #0a7a2f;
  background: linear-gradient(180deg, #f0fff4, #e4fbe8);
  box-shadow: 0 4px 0 rgba(0, 120, 60, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* finish — ee-multi-end */
.finish-hero {
  width: min(100%, 70%);
  margin: 0 auto 12px;
}

.finish-banner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #43b8f2, #1490de);
  color: #fff;
  text-align: center;
  font-size: 27px;
  font-weight: 800;
  box-shadow: 0 5px 0 rgba(14, 105, 170, 0.18), 0 10px 18px rgba(20, 110, 180, 0.12);
}

.winner-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid #f0d66c;
  border-radius: 15px;
  background: linear-gradient(180deg, #fff9df, #fff3bb);
}

.trophy { font-size: 42px; line-height: 1; }

.winner-text { text-align: center; }

.winner-title {
  margin: 0 0 3px;
  color: #6f5200;
  font-size: 24px;
  font-weight: 800;
}

.winner-score {
  color: #9d7200;
  font-size: 18px;
  font-weight: 700;
}

.players-title {
  margin: 8px 0 9px;
  color: #31536c;
  text-align: center;
  font-size: 19px;
  font-weight: 800;
}

.finish-results-block {
  margin-bottom: 12px;
}

.finish-scoreboard {
  margin: 0 auto 13px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  max-width: 100%;
  justify-content: center;
}

.finish-scoreboard.players-2 {
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  max-width: 420px;
}

.finish-scoreboard.players-3 {
  max-width: 560px;
}

.finish-scoreboard.players-4,
.finish-scoreboard.players-5,
.finish-scoreboard.players-6 {
  max-width: 100%;
}

.finish-scoreboard .player-card {
  position: relative;
  min-width: 0;
  padding: 11px 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fbfdff;
  text-align: center;
}

.finish-scoreboard .player-card.first {
  background: linear-gradient(180deg, #fff9df, #fff3bb);
  border-color: #f2d97a;
}

.finish-scoreboard .player-card.second {
  background: linear-gradient(180deg, #f8fafc, #edf2f6);
  border-color: #d6dee5;
}

.finish-scoreboard .player-card.third {
  background: linear-gradient(180deg, #fff2e8, #ffe4cf);
  border-color: #efc3a2;
}

.finish-scoreboard .place-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f5fd;
  color: #1675b8;
  font-size: 13px;
  font-weight: 800;
}

.finish-scoreboard .first .place-badge {
  background: var(--gold);
  color: #7d5600;
}

.finish-scoreboard .second .place-badge {
  background: var(--silver);
  color: #52606d;
}

.finish-scoreboard .third .place-badge {
  background: var(--bronze);
  color: #6b3414;
}

.finish-scoreboard .player-name {
  display: block;
  margin: 2px 0 4px;
  padding: 0 28px;
  overflow: hidden;
  color: #28506a;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finish-scoreboard .player-score {
  display: block;
  color: #0f7cc8;
  font-size: 21px;
  font-weight: 800;
}

.finish-scoreboard .first .player-score { color: #c48a00; }
.finish-scoreboard .second .player-score { color: #6d7c89; }
.finish-scoreboard .third .player-score { color: #b66f3d; }

.finish-scoreboard .player-card.offline {
  opacity: 0.85;
}

.finish-scoreboard .player-card.offline .player-name {
  color: #6f8295;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 13px;
}

.summary-item {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 1px solid #d5e8f6;
  border-radius: 12px;
  background: #eef8ff;
  text-align: center;
}

.summary-item strong {
  display: block;
  color: #0f77bd;
  font-size: 19px;
  font-weight: 800;
}

.summary-item span {
  color: #6b8193;
  font-size: 13px;
  font-weight: 700;
}

.rematch-status {
  width: min(100%, 58%);
  max-width: 320px;
  margin: 0 auto 14px;
  padding: 0;
  text-align: center;
}

.rematch-player-list {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rematch-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfdff;
}

.rematch-chip.pending {
  border-color: #f0b060;
  background: linear-gradient(180deg, #fff8ee, #ffedd4);
}

.rematch-chip.approved {
  border-color: #b8e6c4;
  background: linear-gradient(180deg, #f0fff4, #e4fbe8);
}

.rematch-name {
  color: #28506a;
  font-size: 16px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rematch-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.rematch-badge.pending {
  background: linear-gradient(180deg, #ffb347, #e07a00);
  color: #fff;
  box-shadow: 0 4px 0 rgba(160, 90, 0, 0.18);
}

.rematch-badge.approved {
  color: #0a7a2f;
}

.rematch-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0a7a2f;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.rematch-kick-hint {
  margin: 0 0 8px;
  color: #6f5200;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.rematch-host-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border: 2px dashed #f0b060;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf2, #fff4e3);
}

.rematch-host-actions .host-kick {
  min-height: 52px;
  font-size: 18px;
}

.rematch-waiting-text {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: #5a6a8a;
}

.finish-main-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 12px;
}

.actions.finish-main-actions {
  display: flex;
  grid-template-columns: unset;
}

.finish-main-actions .action-btn {
  width: min(100%, 360px);
  margin: 0 auto;
}

.finish-home-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 14px 0 0;
}

.actions.finish-home-actions {
  display: flex;
  grid-template-columns: unset;
}

.finish-home-actions .action-btn {
  width: min(100%, 280px);
}

.finish-review-embed {
  margin: 0 0 14px;
  padding-top: 4px;
}

.finish-review-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}

.finish-review-scoreboard {
  margin-bottom: 10px;
}

.finish-review-table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
}

.finish-review-table {
  width: 100%;
  min-width: 280px;
}

.finish-review-legend {
  margin-top: 0;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.action-btn {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  cursor: pointer;
}

.action-btn.play-again {
  background: linear-gradient(180deg, #25c743, #0c9e26);
  box-shadow: 0 5px 0 rgba(8, 120, 29, 0.18);
}

.action-btn.view-answers-btn {
  background: linear-gradient(180deg, #ffb347, #e07a00);
  box-shadow: 0 5px 0 rgba(160, 90, 0, 0.18);
}

.action-btn.home-btn {
  background: linear-gradient(180deg, #43b8f2, #1490de);
  box-shadow: 0 5px 0 rgba(14, 105, 170, 0.18);
}

.action-btn.host-kick {
  background: linear-gradient(180deg, #ffb347, #e07a00);
  box-shadow: 0 5px 0 rgba(160, 90, 0, 0.18);
}

.action-btn.host-kick:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 5px 0 rgba(160, 90, 0, 0.1);
}

.finish-note {
  margin-top: 11px;
  color: #8393a3;
  text-align: center;
  font-size: 13px;
}

.back-finish-btn {
  min-height: 46px;
  padding: 8px 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #43b8f2, #1490de);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(14, 105, 170, 0.18);
}

#adLoading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#adLoading.show { display: flex; }

#adLoading p {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}

.ad-ring {
  width: 54px;
  height: 54px;
  border: 5px solid rgba(147, 197, 253, 0.32);
  border-top-color: #3b82f6;
  border-radius: 50%;
  transform-origin: center center;
  will-change: transform;
}

/* modals — first style */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(18, 28, 80, 0.55);
  backdrop-filter: blur(4px);
}

.modal.show { display: flex; }

.modal-card {
  position: relative;
  width: min(390px, calc(100vw - 24px));
  max-height: 90vh;
  overflow: auto;
  border-radius: 28px;
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, #ffffff, #fff4df);
  box-shadow: 0 12px 0 rgba(207, 185, 162, 0.55), 0 26px 50px rgba(0, 0, 0, 0.22), inset 0 2px 0 #fff;
}

.modal-card h2 {
  margin: 4px 0 12px;
  font-size: 27px;
  color: #0868e8;
  font-weight: 900;
}

.modal-card p {
  margin: 8px 0;
  font-size: 16px;
  line-height: 1.45;
  color: #17315d;
  font-weight: 900;
}

.modal-close {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  color: #17366f;
  background: linear-gradient(180deg, #fff, #f2f6ff);
  box-shadow: 0 3px 0 rgba(166, 185, 220, 0.42);
}

.online-room-modal { z-index: 120; }

.online-modal-card {
  max-width: min(420px, calc(100vw - 20px));
  text-align: center;
}

.online-modal-title { font-size: 27px; margin: 4px 0 6px; }

.online-room-modal.host-lobby .online-modal-title,
.online-room-modal.guest-lobby .online-modal-title {
  font-size: 19px;
  line-height: 1.15;
  margin: 0 0 4px;
}

.online-room-modal.guest-waiting-lobby .online-modal-title {
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-status {
  font-size: 15px;
  line-height: 1.45;
  color: #17315d;
  font-weight: 800;
  margin: 4px 0 10px;
}

.online-room-modal.host-lobby .online-status {
  margin: 2px 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

.online-room-modal.host-lobby .online-modal-card {
  align-items: center;
  max-height: min(92vh, 700px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #9eb8e8 transparent;
  padding: 16px 14px 14px;
}

.online-room-modal.host-lobby .online-modal-card::-webkit-scrollbar { width: 6px; }
.online-room-modal.host-lobby .online-modal-card::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.online-room-modal.host-lobby .online-modal-card::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b8cff5, #8eb0ea);
  border-radius: 999px;
}

.room-share-box {
  margin: 0 auto 14px;
  max-width: 340px;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 16px;
  text-align: center;
}

.room-share-box.hidden { display: none !important; }

.room-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.room-share-label { font-size: 14px; font-weight: 900; color: #166534; }

.room-link-input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 2px solid #d1fae5;
  border-radius: 12px;
  font-size: 12px;
  direction: ltr;
  text-align: left;
  background: #fff;
  color: #334155;
  font-family: 'Arimo', Arial, sans-serif;
  box-sizing: border-box;
}

.room-copy-btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
  font-family: 'Arimo', Arial, sans-serif;
  background: linear-gradient(180deg, #39d1ff, #126cff);
  color: #fff;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 80, 190, 0.35);
  flex-shrink: 0;
}

.online-name-section {
  margin: 0 auto 14px;
  max-width: 340px;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid #e4eefd;
  border-radius: 16px;
  text-align: center;
}

.online-name-section.host-name-mode { padding: 10px 12px; text-align: right; }

.online-name-label {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: #17366f;
  margin-bottom: 8px;
}

.online-name-label-main { font-size: 19px; line-height: 1.35; margin-bottom: 10px; }

.online-name-label-inline {
  display: none;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  color: #17366f;
  white-space: nowrap;
  flex-shrink: 0;
}

.online-name-section.host-name-mode .online-name-label-main,
.online-name-section.guest-joined-name-mode .online-name-label-main { display: none; }

.online-name-section.host-name-mode .online-name-label-inline,
.online-name-section.guest-joined-name-mode .online-name-label-inline { display: block; }

.online-name-row { display: flex; gap: 8px; align-items: center; margin-bottom: 0; }

.online-name-section:not(.host-name-mode):not(.guest-joined-name-mode) .online-name-row {
  flex-direction: column;
  margin-bottom: 0;
}

.online-name-section:not(.host-name-mode):not(.guest-joined-name-mode) .online-name-save {
  width: 100%;
  margin-top: 10px;
}

.online-name-section.host-name-mode .online-name-row,
.online-name-section.guest-joined-name-mode .online-name-row {
  flex-direction: row;
  direction: rtl;
}

.online-name-section.host-name-mode .online-name-row input,
.online-name-section.guest-joined-name-mode .online-name-row input {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: none;
  padding: 10px;
  font-size: 16px;
  text-align: center;
}

.online-name-section.host-name-mode .online-name-save,
.online-name-section.guest-joined-name-mode .online-name-save {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 16px;
  white-space: nowrap;
}

.online-name-section.guest-joined-name-mode { padding: 10px 12px; text-align: right; }

.online-name-section.host-name-mode,
.online-name-section.guest-joined-name-mode {
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-room-modal.host-lobby .room-share-box { margin-bottom: 10px; padding: 10px 12px; }
.online-room-modal.host-lobby .online-name-section { margin-bottom: 10px; padding: 10px 12px; }
.online-room-modal.host-lobby .host-start-row { margin-bottom: 8px; }
.online-room-modal.host-lobby .online-lobby-wrap { margin-bottom: 8px; }

.online-room-modal.host-lobby .online-lobby-list {
  max-height: 140px;
  scrollbar-width: thin;
  scrollbar-color: #9eb8e8 transparent;
}

.online-room-modal.host-lobby .online-lobby-list::-webkit-scrollbar { width: 5px; }
.online-room-modal.host-lobby .online-lobby-list::-webkit-scrollbar-thumb {
  background: #b8cff5;
  border-radius: 999px;
}

.online-room-modal.host-lobby .online-name-section,
.online-room-modal.host-lobby .online-lobby-wrap,
.online-room-modal.host-lobby .room-share-box,
.online-room-modal.host-lobby .host-start-row,
.online-room-modal.host-lobby #onlineWaiting {
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-room-modal.guest-waiting-lobby .online-status,
.online-room-modal.guest-waiting-lobby #roomShareBox,
.online-room-modal.guest-waiting-lobby #hostStartRow,
.online-room-modal.guest-waiting-lobby #onlineWaiting { display: none !important; }

.online-room-modal.guest-waiting-lobby .online-modal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.online-room-modal.guest-waiting-lobby .online-name-section {
  order: 1;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-room-modal.guest-waiting-lobby .guest-waiting-banner {
  order: 2;
  margin: 10px auto 0;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-room-modal.guest-waiting-lobby .online-lobby-wrap {
  order: 3;
  margin-top: 16px;
  width: 100%;
  max-width: 340px;
  box-sizing: border-box;
}

.online-name-row input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 2px solid #d8e7f6;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  font-family: 'Arimo', Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #17366f;
}

.online-name-save {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  font-family: 'Arimo', Arial, sans-serif;
  background: linear-gradient(180deg, #ffe83f, #ffbd00);
  color: #17366f;
  box-shadow: 0 4px 0 rgba(204, 124, 0, 0.4);
}

.online-name-error { color: #b00000; font-size: 13px; font-weight: 900; margin-top: 8px; }
.online-name-error.hidden { display: none !important; }

.host-start-row { margin: 0 auto 12px; max-width: 340px; }
.host-start-row.hidden { display: none !important; }
.host-start-row .online-start-btn { width: 100%; margin: 0; }

.online-lobby-wrap { margin: 0 auto 10px; max-width: 340px; text-align: right; }

.online-lobby-heading {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 900;
  color: #0868e8;
  text-align: center;
}

.online-lobby-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.online-lobby-empty {
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px dashed #c9d9ef;
  color: #5b6f8d;
  font-weight: 800;
  text-align: center;
  font-size: 14px;
}

.online-lobby-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e4eefd;
  font-weight: 900;
  color: #17366f;
}

.online-lobby-player.is-me { border-color: #126cff; background: #f2f8ff; }
.online-lobby-player.is-host .online-lobby-name { color: #0868e8; }

.online-lobby-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef5ff;
  font-size: 13px;
  flex-shrink: 0;
}

.online-lobby-name { flex: 1; text-align: right; }

.online-lobby-you {
  font-size: 12px;
  color: #126cff;
  background: #e8f3ff;
  border-radius: 999px;
  padding: 3px 8px;
}

.online-lobby-host-badge {
  font-size: 12px;
  color: #7b3fd4;
  background: #f3ebff;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 900;
}

.online-lobby-in-room {
  font-size: 12px;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  padding: 3px 8px;
  font-weight: 900;
  flex-shrink: 0;
}

.online-lobby-pending-summary {
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff8eb;
  border: 1px dashed #f0c878;
  color: #8a4b00;
  font-weight: 900;
  text-align: center;
  font-size: 14px;
}

.online-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
  color: #166534;
  font-weight: 800;
}

.online-waiting.hidden { display: none !important; }
.online-waiting p { margin: 0; font-size: 14px; }

.guest-waiting-banner {
  width: 100%;
  max-width: 340px;
  margin: 14px auto 6px;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  font-family: 'Arimo', Arial, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #7cff9a, #1bbf5c);
  box-shadow: 0 5px 0 rgba(0, 120, 60, 0.4);
  pointer-events: none;
}

.guest-waiting-banner.hidden { display: none !important; }

.wait-anim { width: 190px; margin: auto; }
.wait-anim .line { position: relative; height: 28px; }

.wait-anim .line i {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateY(-50%);
}

.wait-anim .p2 { left: 0; background: #b7c2d8; }
.wait-anim .me { right: 0; background: #28b86f; box-shadow: 0 0 0 4px rgba(40, 184, 111, 0.2); }

.wait-anim .rail {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 50%;
  height: 10px;
  overflow: hidden;
  border-radius: 10px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.32) 0 18px, transparent 18px 36px), #d8e1ef;
}

.wait-anim .signal {
  position: absolute;
  top: 0;
  left: -50px;
  width: 50px;
  height: 100%;
  border-radius: 10px;
  background: #4f87ff;
  animation: wait-connect 1.6s linear infinite;
}

.wait-anim small {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: #8790a2;
  font-size: 14px;
  direction: ltr;
}

.wait-anim em { min-width: 55px; font-style: normal; }
.wait-anim em:first-child { text-align: left; transform: translateX(-18px); }
.wait-anim em:last-child { text-align: right; transform: translateX(18px); }

@keyframes wait-connect {
  0% { left: -50px; }
  100% { left: 100%; }
}

.online-start-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  font-family: 'Arimo', Arial, sans-serif;
  background: linear-gradient(180deg, #7cff9a, #1bbf5c);
  color: #fff;
  box-shadow: 0 5px 0 rgba(0, 120, 60, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.online-start-btn-label {
  direction: rtl;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4em;
}

.online-start-btn-main { font-size: 16px; font-weight: 900; color: #fff; white-space: nowrap; }
.online-start-btn-sep { font-size: 15px; font-weight: 900; color: #fff; line-height: 1; white-space: nowrap; }
.online-start-btn-hint { white-space: nowrap; }
.online-start-btn-hint-note { font-size: 12px; font-weight: 800; color: #111; }
.online-start-btn-sep.hidden,
.online-start-btn-hint.hidden { display: none !important; }
.online-start-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.online-room-modal.host-lobby .online-modal-card { border-top: 4px solid #126cff; }
.online-room-modal.guest-lobby .online-modal-card { border-top: 4px solid #ffbd00; }

.room-notice-modal { z-index: 200; }

.room-notice-modal-card { max-width: min(390px, calc(100vw - 24px)); text-align: center; }

.room-notice-modal-message {
  margin: 12px 0 18px;
  font-size: 17px;
  line-height: 1.5;
  color: #17315d;
  font-weight: 900;
}

.room-notice-modal .online-start-btn { margin: 0 auto; min-width: 140px; }

.leave-game-modal { z-index: 210; }

.leave-game-modal-card {
  max-width: min(420px, calc(100vw - 24px));
  text-align: center;
}

.leave-game-modal-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #17315d;
}

.leave-game-modal-message {
  margin: 12px 0 18px;
  font-size: 17px;
  line-height: 1.5;
  color: #17315d;
  font-weight: 700;
}

.leave-game-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.leave-game-btn {
  min-height: 44px;
  min-width: 120px;
  padding: 8px 18px;
  border: 0;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.leave-game-cancel {
  background: #e8eef3;
  color: #2a3f55;
}

.leave-game-confirm {
  background: linear-gradient(180deg, #ef5a62, #d93a44);
  color: #fff;
}

@media (max-width: 1280px) {
  .game-ad-left,
  .game-ad-right { display: none; }

  .game-layout {
    display: block;
    padding: 0;
  }

  #main_container { width: 100%; }

  .app {
    width: calc(100% - 10px);
    margin: 14px auto 28px;
  }
}

@media (max-width: 640px) {
  .app { width: calc(100% - 8px); margin-top: 6px; }
  .panel { padding: 9px; border-radius: 14px; }

  .more-versions {
    margin-top: 36px;
    max-width: 390px;
  }

  .more-versions-title {
    font-size: 19px;
    margin-bottom: 16px;
  }

  .related-games-strip {
    gap: 14px;
  }

  .related-game-info {
    min-height: 92px;
    padding: 10px 7px 0;
  }

  .related-game-title {
    font-size: 16px;
  }

  .related-game-desc {
    font-size: 12px;
    line-height: 1.26;
  }

  .related-game-img-wrap {
    padding: 0 0 8px;
    margin-top: -14px;
  }

  .related-game-img {
    max-width: 160px;
  }

  .letter-frame { height: 170px; }
  .letter-value { font-size: 120px; }

  .categories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .category-card label { font-size: 1rem; }
  .category-card input { height: 42px; font-size: 1rem; }

  .play-scoreboard { gap: 5px; }
  .play-score-card .name { font-size: 12px; }

  .review-topbar { align-items: stretch; }
  .top-info { width: 100%; justify-content: center; }
  .pill { min-height: 44px; padding: 7px 12px; font-size: 16px; }
  .next-round-btn { width: 100%; min-height: 46px; font-size: 17px; }

  .scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .score-card { padding: 7px 4px; }
  .score-card .name { font-size: 13px; }
  .score-card .score { font-size: 15px; }

  .category-head { width: 70px; }
  .compare-table th, .compare-table td { padding: 5px 3px; }
  .compare-table thead th { font-size: 13px; }
  .player-name { font-size: 14px; }
  .player-total { font-size: 10px; }
  .category-cell { font-size: 14px; }
  .answer-box { min-height: 39px; padding: 4px; font-size: 13px; }
  .points { min-width: 24px; height: 21px; padding: 0 4px; font-size: 11px; }
  .switch-label { min-width: 145px; font-size: 13px; }

  .finish-banner { min-height: 52px; font-size: 23px; border-radius: 13px; }
  .winner-box { gap: 9px; padding: 11px 8px; }
  .trophy { font-size: 34px; }
  .winner-title { font-size: 21px; }
  .winner-score { font-size: 16px; }

  .finish-scoreboard .player-card { padding: 9px 4px; }
  .finish-scoreboard .place-badge {
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    font-size: 11px;
  }
  .finish-scoreboard .player-name { padding: 0 22px; font-size: 13px; }
  .finish-scoreboard .player-score { font-size: 17px; }

  .summary-strip { gap: 5px; }
  .summary-item { min-height: 48px; padding: 5px 3px; }
  .summary-item strong { font-size: 16px; }
  .summary-item span { font-size: 11px; }

  .actions { grid-template-columns: 1fr; }
  .action-btn { min-height: 47px; font-size: 18px; }
  .rematch-name { font-size: 14px; }
  .rematch-badge { font-size: 12px; min-height: 30px; padding: 5px 10px; }
}
