/* Berlin Ludo — koyu lacivert, altın vurgu */

:root {
  --c-bg:       #07111f;
  --c-surface:  #0e1a2e;
  --c-surface2: #15263f;
  --c-accent:   #7c4dff;
  --c-gold:     #ffce45;
  --c-gold2:    #e0a820;
  --c-gold-glow: rgba(255, 206, 69, 0.4);
  --c-border:   #252545;
  --c-text:     #ffffff;
  --c-muted:    #8b8bae;

  /* Brighter, more vibrant Ludo colors */
  --red:    #ff3333;
  --blue:   #3366ff;
  --green:  #22cc66;
  --yellow: #ffcc00;

  --red-light:    #ff8080;
  --blue-light:   #80aaff;
  --green-light:  #a0ffc0;
  --yellow-light: #fff0a0;

  --radius: 16px;
  --shadow: 0 12px 48px rgba(0,0,0,0.8);
  --glass:  rgba(255, 255, 255, 0.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: max(env(safe-area-inset-top, 0px), var(--tg-top, 0px));
  padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-bottom, 0px));
}

/* ---- TYPOGRAPHY & GENERAL ---- */
h1, h2, h3, h4, h5, h6 { font-family: 'Cinzel', serif; }

.input-group { margin-bottom: 20px; width: 100%; }
.input-group label {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--c-gold);
  margin-bottom: 8px;
  font-weight: 700;
}
input[type="text"] {
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus {
  border-color: var(--c-gold);
  box-shadow: 0 0 0 3px rgba(240,192,64,0.15);
}

/* ---- BUTTONS ---- */
.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  border: none;
  border-radius: 8px;
  padding: 13px 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--c-gold), var(--c-gold2));
  color: #1a1200;
  box-shadow: 0 4px 16px rgba(240,192,64,0.4);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 24px rgba(240,192,64,0.6);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--c-surface2);
  color: var(--c-gold);
  border: 1px solid var(--c-gold);
}
.btn-secondary:hover:not(:disabled) { background: rgba(240,192,64,0.1); }

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover:not(:disabled) { color: var(--c-text); border-color: var(--c-text); }

.btn-wide { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ---- SCREENS ---- */
.screen { display: none; min-height: 100dvh; position: relative; }
.screen.active { display: flex; }

/* ---- HOME ---- */
.glass-bg {
  position: absolute; inset: 0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(124, 77, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 206, 69, 0.08) 0%, transparent 40%);
  pointer-events: none;
}
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

/* NAME SCREEN */
#screen-name { align-items: center; justify-content: center; }
.name-content { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 20px; }
.name-card { 
  padding: 48px; width: 100%; gap: 24px;
  animation: card-slide-up 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes card-slide-up {
  0% { transform: translateY(40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* DISCOVERY SCREEN */
#screen-discovery { padding: 40px; overflow-y: auto; display: none; }
#screen-discovery.active { display: block; }
.discovery-content { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 40px; }
.discovery-header { display: flex; justify-content: space-between; align-items: center; }
.user-greeting { font-family: 'Rajdhani', sans-serif; font-size: 24px; font-weight: 700; }
.user-greeting span { color: var(--c-gold); }

.discovery-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; }
.section-title { font-family: 'Cinzel', serif; font-size: 20px; color: var(--c-gold); margin-bottom: 24px; letter-spacing: 2px; }

/* Rooms List */
.rooms-list-container {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  min-height: 400px; padding: 20px;
}
.rooms-list { display: grid; gap: 12px; }
.room-item {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 20px;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
}
.room-item:hover { transform: translateX(8px); border-color: var(--c-gold); }
.room-info { display: flex; flex-direction: column; gap: 4px; }
.room-host { font-weight: 700; font-size: 16px; }
.room-meta { font-size: 12px; color: var(--c-muted); font-family: 'Rajdhani', sans-serif; letter-spacing: 1px; }
.room-id { background: var(--c-surface); padding: 4px 10px; border-radius: 4px; color: var(--c-gold); }
.room-players-count { font-size: 14px; color: var(--c-text); background: rgba(255,255,255,0.05); padding: 6px 14px; border-radius: 20px; }

.discovery-sidebar { display: flex; flex-direction: column; gap: 20px; }
.card-title { font-family: 'Rajdhani', sans-serif; font-size: 18px; font-weight: 700; color: var(--c-gold); margin-bottom: 8px; text-transform: uppercase; }
.card-desc { font-size: 13px; color: var(--c-muted); margin-bottom: 20px; line-height: 1.5; }
.join-card .join-row { margin-top: 12px; }

/* Bot / Create Room Options */
.create-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.option-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.player-count-selector, .bot-toggle-row {
  display: flex; gap: 8px;
}
.count-btn, .toggle-btn {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  color: var(--c-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
}
.count-btn:hover, .toggle-btn:hover {
  border-color: var(--c-gold);
  color: var(--c-text);
  background: rgba(255, 206, 69, 0.06);
}
.count-btn.active, .toggle-btn.active {
  border-color: var(--c-gold);
  background: rgba(255, 206, 69, 0.15);
  color: var(--c-gold);
  box-shadow: 0 0 12px rgba(255, 206, 69, 0.15);
}

.btn-wide { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.home-footer {
  color: var(--c-muted);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 2px;
  text-align: center;
}
.siva-credit {
  color: var(--c-gold);
  font-weight: 700;
  display: block;
  margin-top: 8px;
  text-shadow: 0 0 8px var(--c-gold-glow);
}

/* ---- LOBBY ---- */
#screen-lobby {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1a1a40 0%, #0d0d1a 70%);
}
.lobby-bg { position: absolute; inset: 0; pointer-events: none; }
.lobby-content {
  position: relative; z-index: 1;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 24px;
}
.lobby-title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: var(--c-gold);
  text-align: center;
}
.room-code-display {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 14px 20px;
}
.room-code-display span { color: var(--c-muted); font-size: 13px; }
.room-code-display strong {
  font-family: 'Rajdhani', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--c-gold);
}
.btn-copy {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 4px; border-radius: 4px;
  transition: transform 0.2s;
}
.btn-copy:hover { transform: scale(1.2); }
.players-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.player-slot {
  background: var(--c-bg);
  border: 2px solid var(--c-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.3s;
}
.player-slot.occupied { border-color: var(--c-gold); }
.player-slot .slot-color {
  width: 24px; height: 24px;
  border-radius: 50%;
  margin: 0 auto 8px;
}
.player-slot .slot-name { font-weight: 700; font-size: 14px; }
.player-slot .slot-status { font-size: 11px; color: var(--c-muted); margin-top: 4px; }
.lobby-status {
  text-align: center;
  color: var(--c-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.lobby-btns { display: flex; gap: 12px; }
.lobby-btns .btn { flex: 1; }

/* ---- GAME SCREEN ---- */
#screen-game { display: none; flex-direction: column; padding: 0; }
#screen-game.active { display: flex; height: 100dvh; max-height: 100dvh; overflow: hidden; }
.game-layout {
  display: grid;
  grid-template-columns: 240px 1fr 200px;
  gap: 16px;
  padding: 16px;
  min-height: 100dvh;
  align-items: start;
}

/* Player panels */
.sidebar-left { display: flex; flex-direction: column; gap: 12px; }
.player-panels { display: flex; flex-direction: column; gap: 8px; }
.player-panel {
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: 10px;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.player-panel.active-turn {
  border-color: var(--c-gold);
  box-shadow: 0 0 16px rgba(240,192,64,0.3);
  animation: glow-pulse 1.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%,100% { box-shadow: 0 0 16px rgba(240,192,64,0.3); }
  50% { box-shadow: 0 0 28px rgba(240,192,64,0.6); }
}
.panel-color {
  width: 16px; height: 16px;
  border-radius: 50%; flex-shrink: 0;
}
.panel-info { flex: 1; min-width: 0; }
.panel-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-tokens { font-size: 11px; color: var(--c-muted); margin-top: 2px; }
.panel-badge {
  font-size: 10px;
  background: rgba(240,192,64,0.2);
  color: var(--c-gold);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Chat */
.chat-box {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.chat-title {
  padding: 10px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
}
.chat-messages {
  flex: 1;
  height: 160px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.chat-msg {
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg .msg-name { font-weight: 700; margin-right: 4px; }
.chat-input-row {
  display: flex;
  border-top: 1px solid var(--c-border);
}
.chat-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13px;
  padding: 10px 12px;
}
.chat-input-row button {
  background: none; border: none; color: var(--c-gold);
  cursor: pointer; padding: 0 12px;
  font-size: 16px; transition: transform 0.2s;
}
.chat-input-row button:hover { transform: scale(1.2); }
.emoji-bar {
  display: flex; justify-content: space-around; padding: 6px 8px;
  border-top: 1px solid var(--c-border);
}
.emoji-btn {
  cursor: pointer; font-size: 18px; transition: transform 0.2s;
  padding: 2px;
}
.emoji-btn:hover { transform: scale(1.4); }

/* Leave button in game */
.btn-leave-game {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255, 51, 51, 0.1);
  border: 1px solid var(--red);
  color: var(--red-light);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}
.btn-leave-game:hover {
  background: var(--red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 51, 51, 0.4);
}

/* Board */
.board-area {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.turn-banner {
  width: 100%;
  max-width: 560px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  padding: 10px 16px;
}
#turn-text {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}
.timer-bar-wrap {
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
}
.timer-bar {
  height: 100%;
  width: 100%;
  background: var(--c-gold);
  border-radius: 2px;
  transition: width linear;
  transform-origin: left;
}

#ludo-board {
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 80px rgba(240,192,64,0.1);
  cursor: pointer;
  max-width: 100%;
  height: auto;
}

.dice-area {
  display: flex; align-items: center; gap: 20px;
}
.dice-container {
  width: 60px; height: 60px;
  perspective: 300px;
}
.dice {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, #fff, #e8e8e8);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.1s;
  user-select: none;
}
.dice.rolling {
  animation: dice-roll 0.6s ease-in-out;
}
@keyframes dice-roll {
  0%   { transform: rotateX(0)   rotateY(0)   rotateZ(0);   }
  25%  { transform: rotateX(180) rotateY(90)  rotateZ(45);  }
  50%  { transform: rotateX(360) rotateY(180) rotateZ(90);  }
  75%  { transform: rotateX(180) rotateY(270) rotateZ(135); }
  100% { transform: rotateX(0)   rotateY(360) rotateZ(180); }
}
.btn-roll {
  background: linear-gradient(135deg, var(--c-gold), var(--c-gold2));
  color: #1a1200;
  font-size: 18px;
  padding: 14px 32px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(240,192,64,0.5);
  letter-spacing: 2px;
}
.btn-roll:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(240,192,64,0.7);
}

/* Right sidebar */
.sidebar-right { display: flex; flex-direction: column; gap: 12px; }
.game-info-card, .game-log {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}
.info-title {
  padding: 8px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--c-muted);
  border-bottom: 1px solid var(--c-border);
  text-transform: uppercase;
}
#game-info-content { padding: 12px; font-size: 13px; }
.log-messages {
  height: 200px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.log-messages::-webkit-scrollbar { width: 3px; }
.log-messages::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.log-entry {
  font-size: 11px;
  color: var(--c-muted);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}
.log-entry .log-highlight { color: var(--c-text); font-weight: 700; }

/* Emoji reactions */
#emoji-reactions { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 1000; }
.floating-emoji {
  position: fixed;
  font-size: 36px;
  animation: emoji-float 3s ease-out forwards;
  pointer-events: none;
}
@keyframes emoji-float {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-200px) scale(1.5); }
}

/* WINNER SCREEN */
#screen-winner {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #2a2200 0%, #0d0d1a 70%);
}
.winner-bg { position: absolute; inset: 0; pointer-events: none; }
.winner-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  padding: 40px;
}
.trophy-wrap {
  font-size: 80px;
  animation: trophy-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes trophy-bounce {
  0% { transform: scale(0) rotate(-20deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.winner-title {
  font-family: 'Cinzel', serif;
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--c-gold), #fff, var(--c-gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 8px;
}
.winner-name {
  font-size: 28px; font-weight: 700;
  color: var(--c-text);
}
.rankings-list {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 300px;
}
.ranking-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 12px 16px;
}
.rank-num {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  color: var(--c-muted);
  width: 28px;
}
.rank-num.gold { color: #ffd700; }
.rank-num.silver { color: #c0c0c0; }
.rank-num.bronze { color: #cd7f32; }
.rank-color { width: 16px; height: 16px; border-radius: 50%; }
.rank-name { flex: 1; font-weight: 700; }
.winner-btns { display: flex; gap: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--red); color: var(--red-light); }
.toast.success { border-color: var(--green); color: var(--green-light); }

/* Color utilities */
.color-red    { background-color: var(--red); }
.color-blue   { background-color: var(--blue); }
.color-green  { background-color: var(--green); }
.color-yellow { background-color: var(--yellow); }

/* Responsive */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 200px 1fr; }
  .sidebar-right { display: none; }
}
@media (max-width: 760px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    padding: 8px;
    gap: 10px;
    min-height: 0;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: auto;
  }
  .sidebar-left { order: 2; min-width: 0; }
  .board-area { order: 1; width: 100%; max-width: 100%; min-width: 0; }
  #ludo-board {
    width: 100%;
    max-width: min(100%, calc(100dvh - 250px - env(safe-area-inset-bottom, 0px) - var(--tg-top, 0px)));
    min-width: 0;
    height: auto;
  }
  .btn-roll { min-height: 52px; min-width: 120px; }
  .chat-box .chat-messages { height: 100px; }
  .player-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; }
  .player-panel { min-width: 0; }
  .panel-info { min-width: 0; }
  .panel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn, .btn-roll, .tier-btn, .count-btn { min-height: 48px; }
}

#screen-menu { justify-content: center; align-items: flex-start; }
.menu-shell {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.menu-top { display: flex; align-items: center; gap: 10px; }
.avatar-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--c-gold);
  background: #e23b3b; color: #fff; font-weight: 800; font-size: 20px; cursor: pointer;
}
.menu-id { flex: 1; }
.menu-id label { display: block; font-size: 11px; letter-spacing: 1px; color: var(--c-gold); font-weight: 800; }
.coin-pill {
  background: #f0c43a; color: #3a2804; font-weight: 800; border-radius: 999px;
  padding: 8px 12px; white-space: nowrap;
}
.stat-row { color: var(--c-muted); font-size: 13px; font-weight: 700; }
.brand-block h1 { font-size: 34px; letter-spacing: 1px; font-family: 'Nunito', sans-serif; }
.brand-block p { color: var(--c-muted); }
.tier-row, .menu-counts { display: flex; gap: 8px; }
.tier-btn {
  flex: 1; border-radius: 14px; border: 2px solid var(--c-border); background: var(--c-surface2);
  color: #fff; padding: 10px 6px; cursor: pointer; font-weight: 800;
}
.tier-btn span { display: block; font-size: 11px; font-weight: 700; color: var(--c-muted); }
.tier-btn.active { border-color: var(--c-gold); background: #2a2208; }
.tier-btn[data-tier="premium"].active { border-color: #7ec8ff; }
.tier-btn[data-tier="vip"].active { border-color: #d9a441; background: #3a2a08; }
.menu-actions, .menu-links { display: flex; flex-direction: column; gap: 8px; }
.menu-links { flex-direction: row; }
.shop-panel { padding: 14px; }
.shop-panel[hidden], .avatar-picker[hidden] { display: none; }
.shop-item small { display: block; color: var(--c-muted); font-size: 12px; }
#screen-shop, #screen-stars { height: 100dvh; overflow: auto; align-items: flex-start; }
.shop-top { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.shop-top h1 { margin: 0; font-size: 28px; }
.shop-balance { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.shop-tabs button { flex: 0 0 auto; min-height: 34px; border-radius: 999px; border: 1px solid rgba(255,206,69,0.35); background: #122033; color: #fff; font-weight: 800; padding: 0 10px; }
.shop-tabs button.active { background: #ffce45; color: #1a1204; }
#shop-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cosmetic-card { display: grid; gap: 4px; min-width: 0; padding: 8px; border-radius: 14px; background: rgba(14,26,46,0.9); border: 1px solid rgba(255,255,255,0.08); text-align: center; }
.cosmetic-card b, .cosmetic-card small, .cosmetic-card .price { overflow-wrap: anywhere; }
.cosmetic-card img { width: 72px; height: 72px; margin: 0 auto; background: #0b1524; border-radius: 12px; }
.cosmetic-card b { font-size: 13px; }
.cosmetic-card small { color: #8b8bae; font-size: 11px; }
.cosmetic-card .price { color: #ffe27a; font-weight: 800; }
.shop-preview-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,0.55); padding: 16px; }
.shop-preview-modal[hidden] { display: none; }
.shop-preview-card { width: min(360px, 100%); display: grid; gap: 8px; padding: 14px; border-radius: 18px; background: #122033; text-align: center; }
.shop-preview-card img { width: 120px; height: 120px; margin: 0 auto; }
.preview-colors, .preview-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.preview-colors button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; }
#star-packs { display: grid; gap: 8px; }
.pack-row { display: block; width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: #ffce45; color: #1a1204; font-weight: 800; font-size: 16px; }
.shop-preview { flex: 0 0 auto; }
.shop-die, .shop-pawn, .shop-board { width: 40px; height: 40px; display: grid; }
.shop-die {
  grid-template-columns: repeat(3, 1fr); padding: 5px; border-radius: 8px; background: #fff;
}
.shop-die i:nth-child(1), .shop-die i:nth-child(2), .shop-die i:nth-child(4), .shop-die i:nth-child(5) { background: #c81e1e; }
.shop-die i:nth-child(3) { background: transparent; }
.shop-die i { width: 6px; height: 6px; border-radius: 50%; justify-self: center; align-self: center; }
.shop-die[data-skin="dice-gold"] { background: linear-gradient(135deg, #ffe27a, #e0a820); }
.shop-die[data-skin="dice-gold"] i { background: #3a2804; }
.shop-die[data-skin="dice-ruby"] { background: linear-gradient(135deg, #fb7185, #be123c); }
.shop-die[data-skin="dice-ruby"] i { background: #fff7ed; }
.shop-die[data-skin="dice-emerald"] { background: linear-gradient(135deg, #6ee7b7, #047857); }
.shop-die[data-skin="dice-emerald"] i { background: #ecfdf5; }
.shop-pawn {
  place-items: center; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800;
  background: radial-gradient(circle at 32% 30%, #ff8d96, #ff2d3a);
  border: 2px solid #fff;
}
.shop-pawn.token-ring { box-shadow: inset 0 0 0 3px #ffe27a; }
.shop-pawn.token-star b { font-size: 0; }
.shop-pawn.token-star b::before { content: "★"; font-size: 16px; color: #fff6c2; }
.shop-pawn.token-gem b { font-size: 0; }
.shop-pawn.token-gem b::before { content: "◆"; font-size: 16px; color: #fff6c2; }
.shop-pawn.token-crown { box-shadow: inset 0 0 0 3px #ffe27a; }
.shop-board { grid-template-columns: 1fr 1fr; gap: 3px; padding: 5px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(255,255,255,0.35); }
.shop-board i { border-radius: 2px; }
.shop-board i:nth-child(1) { background: #ff2d3a; }
.shop-board i:nth-child(2) { background: #18d15a; }
.shop-board i:nth-child(3) { background: #ffd000; }
.shop-board i:nth-child(4) { background: #2f6bff; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; margin-right: 6px; vertical-align: middle; border: 1px solid #fff; }
.shop-item, .avatar-choice {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--c-border);
}
.avatar-picker { display: flex; gap: 8px; }
.avatar-choice {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #fff; color: #fff; font-weight: 800;
}
.slot-status.ready { color: #8dffb0; }
.room-item.tier-premium { border-color: #7ec8ff; }
.room-item.tier-vip { border-color: #d9a441; }
.dice { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 8px; }
.pip { width: 8px; height: 8px; border-radius: 50%; justify-self: center; align-self: center; background: transparent; }
.pip.on { background: #e23b3b; }
.dice[data-skin="dice-gold"] { background: linear-gradient(135deg, #ffe27a, #e0a820); }
.dice[data-skin="dice-gold"] .pip.on { background: #3a2804; }
.dice[data-skin="dice-ruby"] { background: linear-gradient(135deg, #fb7185, #be123c); }
.dice[data-skin="dice-ruby"] .pip.on { background: #fff7ed; }
.dice[data-skin="dice-emerald"] { background: linear-gradient(135deg, #6ee7b7, #047857); }
.dice[data-skin="dice-emerald"] .pip.on { background: #ecfdf5; }
.dice[data-skin="dice-neon"] { background: #082f49; }
.dice[data-skin="dice-neon"] .pip.on { background: #67e8f9; }
.dice[data-skin="dice-fire"] { background: linear-gradient(135deg, #fb923c, #c2410c); }
.dice[data-skin="dice-fire"] .pip.on { background: #fff7ed; }
.dice[data-skin="dice-ice"] { background: linear-gradient(135deg, #e0f2fe, #7dd3fc); }
.dice[data-skin="dice-ice"] .pip.on { background: #0c4a6e; }
.dice[data-skin="dice-galaxy"] { background: #312e81; }
.dice[data-skin="dice-galaxy"] .pip.on { background: #e9d5ff; }
.dice[data-skin="dice-royal"] { background: linear-gradient(135deg, #fde68a, #b45309); }
.dice[data-skin="dice-royal"] .pip.on { background: #451a03; }
.dice[data-skin="dice-crystal"] { background: linear-gradient(135deg, #f0f9ff, #bae6fd); }
.dice[data-skin="dice-crystal"] .pip.on { background: #0c4a6e; }
.dice[data-skin="dice-diamond"] { background: linear-gradient(135deg, #ffffff, #dbeafe); }
.dice[data-skin="dice-diamond"] .pip.on { background: #1e3a8a; }
.dice[data-skin="dice-retro"] { background: #d6d3d1; }
.dice[data-skin="dice-retro"] .pip.on { background: #111; }
body.win-flash .winner-content { animation: trophy-bounce 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }
.confetti-bit { position: fixed; top: -12px; width: 8px; height: 14px; border-radius: 2px; z-index: 40; animation: confetti-fall 1.4s ease-in forwards; pointer-events: none; }
@keyframes confetti-fall { to { transform: translateY(100dvh) rotate(240deg); opacity: 0; } }
body[data-quality="low"] .confetti-bit,
body[data-quality="low"] .dice.rolling { animation: none; }

body { overflow-x: hidden; }
.berlin-app {
  width: min(440px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 16px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 20% 0%, rgba(217,164,65,0.16), transparent 36%),
    #07111f;
}
.berlin-bar { display: flex; align-items: center; gap: 10px; }
.berlin-mark { width: 52px; height: 52px; border-radius: 16px; overflow: hidden; flex: 0 0 auto; }
.berlin-mark svg { width: 52px; height: 52px; display: block; }
.pass-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.pass-row input { width: 100%; }
.brand-line { height: 4px; border-radius: 4px; margin-top: 12px; background: linear-gradient(90deg, #ff3b4a, #22d36a, #ffd23a, #3d7dff); }
.tier-note { color: var(--c-muted); font-size: 13px; line-height: 1.4; }
.invite-row { display: grid; gap: 8px; }
.guide-visual { height: 72px; border-radius: 16px; display: grid; place-items: center; background: #10233f; font-size: 28px; }
.guide-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#support-text, .support-label input, .support-label select { width: 100%; border-radius: 12px; border: 1px solid var(--c-border); background: #0b1524; color: white; padding: 10px; font: inherit; font-size: 16px; }
#support-text { min-height: 96px; }
.support-label { display: grid; gap: 6px; margin: 10px 0; font-size: 13px; color: #d7c49a; }
.support-ticket { margin-top: 10px; padding: 10px; border-radius: 12px; background: #122033; }
.support-ticket small { display: block; color: #b7c3d6; }
html[dir="rtl"] .berlin-app { text-align: right; }
html[dir="rtl"] .player-card, html[dir="rtl"] .pass-row, html[dir="rtl"] .auth-actions { direction: rtl; }
#screen-game, #ludo-board { direction: ltr; }
.berlin-mark-old {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #f0c43a, #a97812);
  color: #1a1204; font-weight: 900; font-size: 26px;
}
.berlin-brand { flex: 1; display: flex; flex-direction: column; }
.berlin-brand strong { letter-spacing: 0.08em; font-size: 18px; }
.berlin-brand span { color: var(--c-muted); font-size: 13px; }
.berlin-auth, .player-card, .berlin-home .shop-panel {
  background: rgba(14, 26, 46, 0.82);
  border: 1px solid rgba(217, 164, 65, 0.28);
  border-radius: 18px;
  padding: 14px;
}
.berlin-auth { display: flex; flex-direction: column; gap: 8px; }
.berlin-auth .auth-lang { margin-bottom: 4px; }
.berlin-auth .auth-lang select { width: 100%; min-height: 44px; font-size: 16px; }
.berlin-auth[hidden] { display: none; }
.color-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.color-rail i { display: block; height: 18px; border-radius: 9px; }
.color-rail i:nth-child(1) { background: #e23b3b; }
.color-rail i:nth-child(2) { background: #2faa5a; }
.color-rail i:nth-child(3) { background: #f0c43a; }
.color-rail i:nth-child(4) { background: #3d78e0; }
.berlin-auth h1 { font-size: 22px; }
.berlin-auth p, .card-desc { color: var(--c-muted); font-size: 13px; }
.berlin-auth input, #friend-name {
  min-height: 48px; border-radius: 12px; border: 1px solid var(--c-border);
  background: #0b1524; color: white; padding: 0 12px; font-size: 16px;
}
.auth-actions, .home-split, .home-grid { display: grid; gap: 8px; }
.auth-actions, .home-split { grid-template-columns: 1fr 1fr; }
.home-grid { grid-template-columns: repeat(3, 1fr); }
.berlin-home { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.home-dock { margin-top: auto; }
.berlin-home[hidden] { display: none; }
.player-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.player-name { font-size: 20px; font-weight: 800; }
.coin-pill::before { content: "★ "; color: #f0c43a; }
.btn-hero { min-height: 64px; font-size: 22px; letter-spacing: 0.04em; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.7; }
button[hidden] { display: none !important; }
.offline-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 20;
  background: #8a2a2a; color: white; text-align: center; padding: 8px;
}
.home-dock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid rgba(217,164,65,0.4);
  background: #122033; color: #f0c43a; font-size: 22px; flex: 0 0 auto;
}
.avatar-btn { overflow: hidden; padding: 0; }
.avatar-btn img, .rank-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.rank-photo, .mini-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; color: white; font-weight: 800; }
.avatar-lg { width: 72px; height: 72px; font-size: 28px; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 48px; border-bottom: 1px solid var(--c-border);
}
.setting-row select, #display-name, #friend-name { min-height: 40px; background: #0b1524; color: white; border-radius: 10px; border: 1px solid var(--c-border); padding: 0 8px; }
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 8px; align-items: end; }
.podium article { text-align: center; padding: 8px; border-radius: 14px; background: #122033; }
.podium .gold { border: 2px solid #f0c43a; min-height: 110px; }
.podium .silver { border: 2px solid #c9d2df; }
.podium .bronze { border: 2px solid #c47a45; }
.rank-row, .me-rank { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--c-border); }
.me-rank { position: sticky; bottom: 0; background: #0e1a2e; }
.screen .berlin-app { width: min(440px, 100%); }
#screen-shop.active, #screen-ranks.active, #screen-settings.active, #screen-profile.active { display: block; overflow-x: hidden; }
body[data-quality="low"] .dice.rolling { animation: none; }
@media (max-width: 760px) {
  .berlin-app { padding-bottom: 20px; }
  .btn-hero { font-size: 20px; }
  #screen-discovery { padding: 12px; }
  .discovery-content { gap: 12px; max-width: 440px; }
  .discovery-grid { grid-template-columns: 1fr; gap: 12px; }
  .rooms-list-container { min-height: 0; padding: 10px; }
  .section-title { margin-bottom: 10px; }
}

.play-slogan { display: block; color: #f4e2a8; font-size: 13px; font-weight: 800; }
.board-scene[hidden] { display: none; }
.board-scene {
  flex: 1; min-height: 168px; border-radius: 18px; position: relative; overflow: hidden;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #1d4e86, #0b1730 70%);
  border: 1px solid rgba(255,206,69,0.28);
}
.scene-board {
  width: min(210px, 70%); aspect-ratio: 1; display: grid;
  grid-template-columns: 1.3fr 0.7fr 1.3fr; grid-template-rows: 1.3fr 0.7fr 1.3fr; gap: 3px;
}
.scene-board .home { border-radius: 12px; }
.scene-board .home.red { background: #ff2d3a; }
.scene-board .home.green { background: #18d15a; }
.scene-board .home.yellow { background: #ffd000; }
.scene-board .home.blue { background: #2f6bff; }
.scene-board .lane { background: rgba(255,244,196,0.85); border-radius: 4px; }
.scene-board .hub { background: #ffce45; border-radius: 8px; }
.scene-pawn, .scene-die { position: absolute; }
.scene-pawn { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 2px 0 rgba(0,0,0,0.3); }
.scene-pawn.red { left: 22%; top: 22%; background: #fff; box-shadow: inset 0 0 0 5px #ff2d3a; }
.scene-pawn.green { right: 22%; top: 22%; background: #fff; box-shadow: inset 0 0 0 5px #18d15a; }
.scene-pawn.yellow { left: 22%; bottom: 22%; background: #fff; box-shadow: inset 0 0 0 5px #ffd000; }
.scene-pawn.blue { right: 22%; bottom: 22%; background: #fff; box-shadow: inset 0 0 0 5px #2f6bff; }
.scene-die {
  width: 28px; height: 28px; right: 16px; bottom: 16px; border-radius: 7px;
  background:
    radial-gradient(circle at 30% 30%, #1a1204 2.5px, transparent 3px),
    radial-gradient(circle at 70% 70%, #1a1204 2.5px, transparent 3px),
    #fff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.xp-track { height: 6px; margin-top: 4px; border-radius: 6px; background: #0b1524; overflow: hidden; }
.xp-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3d7dff, #22d36a); }
.tier-btn[data-tier="normal"] { background: #163024; }
.tier-btn[data-tier="premium"] { background: #14243f; border-color: rgba(217,164,65,0.45); }
.tier-btn[data-tier="vip"] { background: #241433; border-color: rgba(201,162,39,0.7); }
.home-modes { display: grid; gap: 8px; }
.mode-card {
  text-align: left; color: #fff; background: #122033; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 10px 12px; min-height: 52px; cursor: pointer;
}
.mode-card b, .mode-card span { display: block; }
.mode-card span { color: var(--c-muted); font-size: 12px; font-weight: 700; }
.mode-card:nth-child(1) { border-color: rgba(34,211,106,0.45); }
.mode-card:nth-child(2) { border-color: rgba(61,125,255,0.5); }
.mode-card:nth-child(3) { border-color: rgba(255,210,58,0.5); }
.home-dock {
  position: sticky; bottom: 0; z-index: 2;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: #0c1828; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 4px;
}
.dock-btn {
  min-height: 48px; border: 0; background: transparent; color: #c9d4e4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 12px; cursor: pointer;
}
.dock-btn small { font-size: 10px; font-weight: 800; }
.dock-btn.active, .dock-btn:focus-visible { color: #ffd23a; background: rgba(255,210,58,0.08); }

#screen-game.active { position: relative; align-items: center; background: #07111f; }
.seat-token { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; vertical-align: middle; background: #fff; }
.seat-token.color-red { background: #ff4b55; }
.seat-token.color-blue { background: #4c86ff; }
.seat-token.color-green { background: #3dce67; }
.seat-token.color-yellow { background: #f0c43a; }
.seat-turn .timer-bar-wrap { position: absolute; left: 10px; right: 28px; bottom: 4px; height: 3px; margin: 0; }
.panel-name { display: flex; align-items: center; gap: 4px; }
.table-fit {
  flex: 1; min-height: 0; width: min(720px, 100%); margin: 0 auto; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-start;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px) + var(--tg-top, 0px)) 10px calc(8px + env(safe-area-inset-bottom, 0px) + var(--tg-bottom, 0px));
  background: #07111f;
}
.seat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px; min-width: 0; padding-top: 4px;
}
.seat-row.solo { grid-template-columns: minmax(0, 240px); justify-content: center; }
.seat-card {
  position: relative; min-width: 0; border-radius: 16px; padding: 8px 10px;
  background: #101b30; border: 1.5px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 0;
}
.seat-gap { min-width: 0; }
.seat-card.color-red { border-color: #ff4b55; }
.seat-card.color-blue { border-color: #4c86ff; }
.seat-card.color-green { border-color: #3dce67; }
.seat-card.color-yellow { border-color: #e6b325; }
.seat-card.active-turn { box-shadow: none; }
.seat-turn {
  position: relative; margin-top: 8px; min-height: 46px; padding: 6px 8px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  border: 1.5px solid currentColor; border-radius: 12px; background: #0c1628;
}
.seat-card.color-red .seat-turn { color: #ff4b55; }
.seat-card.color-blue .seat-turn { color: #4c86ff; }
.seat-card.color-green .seat-turn { color: #3dce67; }
.seat-card.color-yellow .seat-turn { color: #e6b325; }
.turn-copy { display: flex; align-items: center; gap: 6px; min-width: 0; color: #fff; }
.turn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.turn-label { font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.turn-chevron { color: #8ea0b8; font-size: 18px; line-height: 1; }
.seat-extra { grid-column: 1 / -1; }
.seat-extra:not(:has(.token-choice:not([hidden]))) { display: none; }
.panel-role { color: #8ea0b8; font-size: 11px; font-weight: 700; line-height: 1.2; }
.seat-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
  z-index: 6; pointer-events: none; white-space: nowrap; max-width: 148px;
  background: #fff8e8; color: #1a1204; border-radius: 10px;
  padding: 3px 8px; font-size: 12px; font-weight: 800; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.seat-bubble[hidden] { display: none; }
.seat-main { display: flex; align-items: center; gap: 6px; min-width: 0; }
.seat-dice:empty, .seat-dice[hidden] { display: none; }
.seat-dice { display: flex; justify-content: center; align-items: center; }
#seats-top, #seats-bottom { padding-top: 0; }
.seat-dice .dice-container, .seat-dice .dice { width: 40px; height: 40px; border-radius: 8px; }
.seat-dice .dice { padding: 5px; font-size: 0; background: linear-gradient(180deg, #fffdf8, #f3ead8); box-shadow: 0 2px 6px rgba(0,0,0,0.28); }
.seat-dice .pip { width: 5px; height: 5px; }
.dice.can-roll { cursor: pointer; outline: 2px solid #ffce45; }
.dice.dice-wait .pip.on { background: #9aa3b2; }
.table-fit .board-area {
  order: 0; min-height: 0; min-width: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.table-fit .turn-banner { width: 100%; padding: 0; }
.table-fit #turn-text { font-size: 13px; }
.table-fit #ludo-board {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.seat-row { align-items: start; }
.log-messages[hidden], #game-info-content[hidden], #dice-park[hidden] { display: none; }
.chat-dock { display: grid; gap: 2px; min-width: 0; }
.chat-dock .chat-messages { height: 22px; padding: 0 4px; font-size: 11px; }
.chat-dock .chat-input-row { border: 1px solid var(--c-border); border-radius: 12px; background: #0e1a2e; overflow: hidden; }
.chat-dock .chat-input-row input { min-height: 36px; font-size: 14px; }
.chat-dock .btn-leave-game { position: static; padding: 0 8px; min-height: 36px; font-size: 11px; border-radius: 0; }
.chat-dock .emoji-bar { padding: 0 2px; }
.room-item { gap: 10px; }
.room-preview { width: 36px; height: 36px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 8px; overflow: hidden; flex: 0 0 auto; }
.room-preview i:nth-child(1) { background: #ff2d3a; }
.room-preview i:nth-child(2) { background: #18d15a; }
.room-preview i:nth-child(3) { background: #ffd000; }
.room-preview i:nth-child(4) { background: #2f6bff; }
.room-item.tier-normal { background: #122033; border-color: rgba(61,125,255,0.4); }
.room-item.tier-premium { background: linear-gradient(180deg, #1a2744, #10192c); border-color: #d9a441; }
.room-item.tier-vip { background: linear-gradient(180deg, #2a1638, #120b1c); border-color: #c9a227; box-shadow: inset 0 0 0 1px rgba(201,162,39,0.35); }
@media (prefers-reduced-motion: reduce) {
  .dice.rolling, .confetti-bit, .player-panel.active-turn { animation: none; }
}

.auth-actions { grid-template-columns: 1fr; }
#btn-login, #btn-register { min-height: 52px; border-radius: 16px; font-size: 16px; }
.play-hero {
  position: relative; min-height: 176px; border-radius: 20px; padding: 12px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #1d4e86, #0b1730 72%);
  border: 1px solid rgba(255,206,69,0.4);
}
.play-hero .scene-board { width: min(132px, 46%); margin-bottom: 48px; }
.play-hero .btn-hero {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  min-height: 52px; border-radius: 16px;
  box-shadow: 0 8px 22px rgba(224,168,32,0.45);
}
.home-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#menu-count { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
#btn-quick { grid-column: 1 / -1; }
.masa-cards { display: grid; gap: 10px; }
.masa-card {
  text-align: left; color: #fff; border-radius: 18px; padding: 14px; min-height: 96px;
  border: 1px solid rgba(255,255,255,0.12); background: #122033; cursor: pointer;
}
.masa-card b, .masa-card span, .masa-card small { display: block; }
.masa-card span { color: #ffce45; font-weight: 800; margin: 4px 0; }
.masa-card small { color: #9aa6bb; font-size: 12px; }
.masa-card.tier-normal { background: linear-gradient(180deg, #143024, #102033); border-color: #22d36a; }
.masa-card.tier-premium { background: linear-gradient(180deg, #14284a, #10192c); border-color: #d9a441; }
.masa-card.tier-vip { background: linear-gradient(180deg, #2a1638, #120b1c); border-color: #c9a227; }
.masa-card.active { box-shadow: 0 0 0 2px #ffce45; }
.board-stage {
  position: relative; flex: 1; min-height: 0; width: 100%;
  display: flex; flex-direction: column; justify-content: flex-start; gap: 8px;
}
.board-stage .seat-row {
  position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px; padding: 0; pointer-events: auto;
}
.board-stage .seat-card {
  width: auto; align-items: stretch; text-align: left;
  background: #101b30; padding: 8px 10px;
}
.board-stage .seat-main { flex-direction: row; gap: 6px; }
.board-stage .mini-avatar {
  width: 40px; height: 40px; min-width: 40px; min-height: 40px; flex: 0 0 40px;
  border: 1.5px solid rgba(255,255,255,0.9); border-radius: 50%; overflow: hidden;
  display: block; background: #1a2740;
}
.board-stage .mini-avatar svg { width: 26px; height: 26px; display: block; margin: 7px auto; }
.board-stage .mini-avatar img {
  width: 40px; height: 40px; max-width: none; object-fit: cover; object-position: center;
  display: block; border-radius: 50%;
}
.board-stage .seat-card.color-red .mini-avatar { border-color: #ff2d3a; }
.board-stage .seat-card.color-green .mini-avatar { border-color: #18d15a; }
.board-stage .seat-card.color-yellow .mini-avatar { border-color: #ffd000; }
.board-stage .seat-card.color-blue .mini-avatar { border-color: #2f6bff; }
@media (max-width: 340px) {
  .board-stage .mini-avatar,
  .board-stage .mini-avatar img { width: 36px; height: 36px; }
  .board-stage .mini-avatar { min-width: 36px; min-height: 36px; flex-basis: 36px; }
}
.board-stage .panel-name { font-size: 13px; font-weight: 800; justify-content: flex-start; min-width: 0; }
.board-stage .panel-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-stage .panel-tokens { display: none; }
.board-stage .seat-dice { position: static; left: auto; right: auto; top: auto; bottom: auto; transform: none; }
.board-stage .board-area {
  order: 0; flex: 0 0 auto; min-height: 0; height: auto; padding: 0;
  justify-content: center; align-items: center; overflow: hidden;
}
.play-bar { margin-top: auto; }
.board-stage #seats-bottom { order: 1; }
.play-bar {
  position: relative;
  width: 100%;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; align-items: stretch; padding: 0;
  background: #101b30; border-radius: 18px; overflow: visible;
  border: 1px solid rgba(255,255,255,0.06);
}
.bar-tab {
  min-height: 62px; border: 0; background: transparent; color: #f0c43a;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-weight: 800; cursor: pointer; padding: 6px 0 8px;
}
.bar-tab + .bar-tab { box-shadow: inset 1px 0 0 rgba(255,255,255,0.08); }
.bar-tab small { color: #f4f7fb; font-size: 11px; font-weight: 700; }
.bar-ico { width: 22px; height: 22px; display: grid; place-items: center; }
.bar-ico svg { width: 22px; height: 22px; fill: none; stroke: #f0c43a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#turn-banner { display: none; }
.game-menu {
  position: absolute; right: 0; bottom: 52px; z-index: 8; width: 196px;
  display: grid; gap: 6px; padding: 8px;
  background: #122033; border: 1px solid rgba(255,206,69,0.4); border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.game-menu[hidden] { display: none; }
.game-menu-row, .game-menu button {
  min-height: 40px; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; color: #fff; background: transparent; border: 0; border-radius: 10px;
  padding: 0 8px; font-weight: 800; text-align: left;
}
.game-menu button { background: #0e1a2e; }
#menu-quit { color: #ffb4b4; }
.bar-icon, .play-bar .btn-leave-game {
  position: static; height: auto; min-height: 62px; border-radius: 0;
  border: 0; background: transparent; color: #f0c43a;
  font-size: 16px; padding: 6px 0 8px; top: auto; right: auto;
}
.play-bar .turn-banner {
  position: static; background: transparent; padding: 0; text-align: center; min-width: 0;
}
.play-bar #turn-text { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.play-bar .timer-bar-wrap { height: 4px; margin-top: 3px; }
.chat-dock { display: none; width: 100%; }
.chat-dock.open { display: grid; }

#screen-menu {
  position: relative; overflow: hidden;
  background: #071018 url('home-bg.jpg') center center / cover no-repeat;
}
#screen-menu .sky-art,
#screen-menu .board-scene { display: none; }
#screen-menu .berlin-app { position: relative; z-index: 1; background: transparent; }
.sky-glow { position: absolute; width: 48px; height: 48px; border-radius: 14px; opacity: 0.85; }
.sky-glow.red { left: 16%; top: 46%; background: #ff3b4a; }
.sky-glow.green { right: 16%; top: 46%; background: #22d36a; }
.sky-glow.yellow { left: 22%; top: 64%; background: #ffd23a; }
.sky-glow.blue { right: 22%; top: 64%; background: #3d7dff; }
.sky-castle {
  position: absolute; left: 50%; top: 54%; width: 140px; height: 118px; transform: translate(-50%, -50%);
  background:
    linear-gradient(#f6e7b2, #f6e7b2) 0 42px / 34px 76px no-repeat,
    linear-gradient(#f6e7b2, #f6e7b2) 106px 42px / 34px 76px no-repeat,
    linear-gradient(#f6e7b2, #f6e7b2) 48px 12px / 44px 94px no-repeat,
    linear-gradient(#c9a15a, #c9a15a) 0 88px / 140px 30px no-repeat,
    linear-gradient(#ff2d3a, #ff2d3a) 70px 0 / 22px 14px no-repeat;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.35));
}
.sky-die {
  position: absolute; right: 18%; top: 34%; width: 36px; height: 36px; border-radius: 8px;
  background:
    radial-gradient(circle at 30% 30%, #c81e1e 3px, transparent 4px),
    radial-gradient(circle at 70% 70%, #c81e1e 3px, transparent 4px),
    linear-gradient(#fff, #f3f3f3);
  box-shadow: 0 8px 16px rgba(0,0,0,0.35);
}
.star-card {
  min-height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; border: 1px solid rgba(255,206,69,0.45);
  background: rgba(42, 34, 8, 0.82); color: #ffe27a; font-weight: 800; font-size: 14px;
  margin-top: 2px;
}
.token-choice { display: flex; justify-content: center; gap: 6px; min-height: 28px; }
.token-choice[hidden] { display: none; }
.token-pick {
  width: 32px; height: 28px; border-radius: 8px; border: 1px solid #fff; color: #fff;
  font-weight: 800; background: #ff2d3a;
}
.token-pick.color-blue { background: #2f6bff; }
.token-pick.color-green { background: #18d15a; }
.token-pick.color-yellow { background: #d7a400; color: #1a1204; }
#ludo-board { touch-action: none; }
#screen-menu.is-home {
  justify-content: flex-start;
  height: 100dvh;
  overflow: auto;
  background: #07111f;
}
#screen-menu.is-home .berlin-bar,
#screen-menu.is-home .board-scene { display: none; }
#screen-menu.is-home .berlin-app {
  height: 100%;
  flex: 1;
  min-height: 100%;
  padding: 12px 12px calc(78px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
  overflow: visible;
}
#screen-menu.is-home .berlin-home { gap: 8px; min-height: 0; flex: 1; }
.home-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
button.player-card {
  width: 100%; min-width: 0; text-align: left; color: inherit; cursor: pointer;
  font: inherit; border: 1px solid rgba(217, 164, 65, 0.28);
}
#screen-menu.is-home .player-card { padding: 8px 10px; align-items: center; background: rgba(14, 26, 46, 0.78); }
.home-ornament {
  height: auto; min-height: 88px; max-height: 200px; border-radius: 14px; flex: 1 1 auto;
  background: transparent url('home-board.jpg') center center / contain no-repeat;
  border: 1px solid rgba(255, 206, 69, 0.28);
}
.home-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.home-tiers button {
  min-height: 48px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(18, 32, 51, 0.92); color: #fff; font-weight: 800; cursor: pointer;
}
.home-tiers button span { display: block; margin-top: 2px; color: #ffd23a; font-size: 11px; font-weight: 700; }
.home-tiers button[data-home-tier="normal"] { border-color: rgba(34, 211, 106, 0.5); }
.home-tiers button[data-home-tier="premium"] { border-color: rgba(61, 125, 255, 0.55); }
.home-tiers button[data-home-tier="vip"] { border-color: rgba(255, 210, 58, 0.7); }
#screen-menu.is-home .berlin-auth { background: rgba(14, 26, 46, 0.86); }
#screen-menu.is-home .star-card {
  min-height: 36px; padding: 0 12px; cursor: pointer; white-space: nowrap;
}
#screen-menu.is-home .play-block { gap: 6px; width: 100%; }
#screen-menu.is-home .quick-link {
  width: 100%; min-height: 36px; border-radius: 12px;
  border: 1px solid rgba(255,206,69,0.4); background: #122033;
}
#screen-menu.is-home .home-dock { background: #102033; }
#screen-menu.is-home .mode-card {
  min-height: 44px; border-radius: 14px; background: rgba(18, 32, 51, 0.82);
  border: 1px solid rgba(255,255,255,0.12);
}
#screen-menu.is-home .avatar-btn { width: 40px; height: 40px; font-size: 16px; }
.player-meta { flex: 1; min-width: 0; }
#screen-menu.is-home .player-name { font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#screen-menu.is-home .stat-row { font-size: 12px; }
.player-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
#screen-menu.is-home .coin-pill { padding: 6px 10px; font-size: 13px; }
#screen-menu.is-home .icon-btn { width: 36px; height: 36px; font-size: 18px; }
.play-block { display: flex; flex-direction: column; align-items: center; gap: 2px; }
#screen-menu.is-home .btn-hero {
  position: static; width: 100%; min-height: 52px; margin: 0;
  box-shadow: 0 4px 12px rgba(224,168,32,0.28);
}
.quick-link {
  border: 0; background: transparent; color: #f4e2a8; font-weight: 800;
  min-height: 32px; padding: 0 8px; cursor: pointer;
}
#screen-menu.is-home #tier-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#screen-menu.is-home .tier-btn { min-height: 56px; padding: 8px 4px; text-align: center; }
#screen-menu.is-home #menu-count { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#screen-menu.is-home .count-btn { min-height: 40px; }
#screen-menu.is-home .count-btn.active { border-color: #ffd23a; background: #2a2208; color: #ffd23a; }
#screen-menu.is-home .home-split { grid-template-columns: 1fr 1fr; }
#screen-menu.is-home .mode-card { min-height: 44px; text-align: center; padding: 8px; }
.home-dock { display: none; }
body.dock-on .home-dock {
  display: grid;
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(440px, 100%);
  margin: 0;
  z-index: 30;
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #102033;
}
body.dock-on #screen-shop .shop-app,
body.dock-on #screen-ranks .berlin-app,
body.dock-on #screen-profile .berlin-app {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}
#screen-profile { height: 100dvh; overflow: auto; align-items: flex-start; }
#screen-profile h2 { margin: 8px 0 0; font-size: 18px; color: #f4e2a8; }
.dock-btn small { white-space: nowrap; font-size: 9px; }
#tier-note[hidden] { display: none; }

#screen-discovery {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding: 0;
  background: #07111f;
  align-items: stretch;
  justify-content: flex-start;
}
#screen-discovery.active { display: flex; }
#screen-discovery .glass-bg,
#screen-discovery .user-greeting,
#screen-discovery .home-footer,
#screen-discovery .card-desc,
#screen-discovery .masa-card small { display: none; }
#screen-discovery .discovery-content {
  width: min(440px, 100%);
  max-width: 440px;
  height: 100%;
  margin: 0 auto;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
#screen-discovery .discovery-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
#screen-discovery .section-title {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: #f4e2a8;
}
#screen-discovery .masa-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#screen-discovery .masa-card {
  min-height: 58px;
  padding: 8px 4px;
  text-align: center;
  border-radius: 14px;
}
#screen-discovery .masa-card b { font-size: 13px; }
#screen-discovery .masa-card span { margin: 2px 0 0; font-size: 12px; }
#screen-discovery .discovery-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  flex: 1;
}
#screen-discovery .discovery-sidebar { gap: 8px; }
#screen-discovery .discovery-main { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1; }
#screen-discovery .glass-card {
  padding: 10px;
  gap: 8px;
  background: #122033;
  box-shadow: none;
  backdrop-filter: none;
}
#screen-discovery .card-title { margin: 0; font-size: 13px; letter-spacing: 0; text-transform: none; font-family: 'Nunito', sans-serif; }
#screen-discovery .create-options { gap: 8px; margin: 0; }
#screen-discovery .option-label { letter-spacing: 0; text-transform: none; font-family: 'Nunito', sans-serif; }
#screen-discovery .count-btn,
#screen-discovery .toggle-btn { min-height: 40px; }
#screen-discovery .join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin: 0; }
#screen-discovery .code-input {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0b1524;
  color: #fff;
  padding: 0 12px;
  font-size: 16px;
}
#screen-discovery .rooms-list-container {
  min-height: 0;
  flex: 0 1 auto;
  max-height: 132px;
  padding: 8px;
  overflow: auto;
}
#screen-discovery .rooms-empty { padding: 8px 4px; font-size: 13px; }
#screen-discovery #btn-create { width: 100%; text-transform: uppercase; letter-spacing: 0.04em; }
#screen-discovery .create-card,
#screen-discovery .join-card { margin: 0; }
#screen-discovery .room-item { padding: 10px; gap: 8px; }
#screen-discovery .room-item:hover { transform: none; }
#screen-menu.is-home {
  background: #071018 url('home-bg.jpg') center center / cover no-repeat;
}
#screen-menu.is-home .berlin-home { gap: 10px; }
#screen-menu.is-home .home-top { align-items: stretch; }
#screen-menu.is-home .player-card {
  border: 1px solid rgba(61, 125, 255, 0.45);
  border-radius: 18px;
  background: #101b30;
  padding: 8px 10px;
}
#screen-menu.is-home .avatar-btn {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid #f0c43a; box-shadow: 0 0 0 2px #e23b3b;
}
.player-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#screen-menu.is-home .xp-track { height: 4px; margin-top: 3px; background: #0b1524; }
#screen-menu.is-home .xp-track i { background: #3d7dff; }
.home-wallet {
  display: flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 4px 4px 4px 8px;
  border-radius: 16px; border: 1px solid rgba(61, 125, 255, 0.45);
  background: #142033;
}
.wallet-star { color: #f0c43a; font-size: 16px; line-height: 1; }
.home-wallet .coin-pill {
  border: 0; background: transparent; color: #fff; font-weight: 800;
  min-height: 32px; padding: 0 2px; cursor: pointer;
}
.home-wallet .coin-pill::before { content: none; }
.star-plus {
  width: 32px; height: 32px; border: 0; border-radius: 10px;
  background: #f0c43a; color: #1a1204; font-size: 22px; font-weight: 800;
  line-height: 1; cursor: pointer;
}
.brand-logo { width: min(250px, 78%); margin: 0 auto; }
.brand-logo img { width: 100%; height: auto; display: block; border-radius: 0; }
#screen-menu.is-home .btn-hero {
  min-height: 54px; border-radius: 18px; font-size: 22px; letter-spacing: 0.08em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(180deg, #ffe27a, #e0a820);
  color: #1a1204; border: 1px solid #fff1b0;
  box-shadow: 0 8px 18px rgba(224, 168, 32, 0.35);
}
.play-mark {
  width: 0; height: 0;
  border-left: 14px solid #1a1204;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.mode-tile {
  min-height: 92px; border-radius: 16px; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 4px;
}
.mode-tile b { font-size: 13px; letter-spacing: 0.04em; }
.mode-tile span { font-size: 11px; color: #d5deea; font-weight: 700; }
.mode-crown {
  width: 40px; height: 28px; margin-bottom: 0; background: none;
}
.mode-normal .mode-crown { color: #d5deea; }
.mode-premium .mode-crown, .mode-vip .mode-crown { color: #f0c43a; }
#screen-menu.is-home .mode-tile.mode-normal { background: linear-gradient(180deg, #1d4e9a, #16356d); border-color: #4c86ff; }
#screen-menu.is-home .mode-tile.mode-premium { background: linear-gradient(180deg, #6d28d9, #4c1d95); border-color: #a78bfa; }
#screen-menu.is-home .mode-tile.mode-vip { background: linear-gradient(180deg, #b42318, #7f1d1d); border-color: #f04438; }
#screen-menu.is-home .mode-tile span { color: #e7eef8; font-size: 11px; }
#screen-menu.is-home .home-split { grid-template-columns: 1fr 1fr; gap: 8px; }
#screen-menu.is-home .mode-card {
  min-height: 48px; border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; text-align: left;
  background: #122033; border: 1px solid rgba(61, 125, 255, 0.45);
}
#screen-menu.is-home .mode-card b { font-size: 11px; font-weight: 800; white-space: nowrap; }
.mode-ico { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: #f0c43a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-go { color: #d5e2f2; font-size: 18px; font-weight: 700; flex: 0 0 auto; }
.home-ornament {
  height: 168px; max-height: 180px; border-radius: 0; border: 0;
  box-shadow: none;
  background: transparent url('home-board.png') center bottom / contain no-repeat;
}
.home-dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#screen-match {
  min-height: 100dvh; display: none; align-items: center; justify-content: center;
  background: #07111f; padding: 24px;
}
#screen-match.active { display: flex; }
.match-card {
  width: min(360px, 100%); text-align: center; display: grid; gap: 12px;
  background: #101b30; border: 1px solid rgba(61, 125, 255, 0.4);
  border-radius: 18px; padding: 20px;
}
.match-card h1 { margin: 0; color: #f4e2a8; font-size: 22px; }
body.dock-on .home-dock {
  width: min(440px, 100%);
  border: 1px solid rgba(61, 125, 255, 0.35);
  background: #101b30;
}
.dock-btn.active { color: #f0c43a; box-shadow: inset 0 -3px 0 #f0c43a; }
@media (max-width: 360px) {
  #screen-menu.is-home .home-split { grid-template-columns: 1fr 1fr; }
  .mode-tile { min-height: 84px; }
  .mode-tile b { font-size: 11px; }
  .mode-vip .mode-fee { font-size: 9px; }
}

#screen-shop,
#screen-ranks,
#screen-profile,
#screen-stars,
#screen-discovery,
#screen-match {
  background: #071018 url('home-bg.jpg') center center / cover no-repeat;
}
#screen-menu.is-home .berlin-app {
  width: min(430px, 100%);
  margin: 0 auto;
}
#screen-menu.is-home .berlin-home {
  font-family: Nunito, sans-serif;
  gap: 6px;
}
#screen-menu.is-home .player-card { padding: 6px 8px 6px 6px; }
#screen-menu.is-home .stat-row { color: #b7c6da; font-size: 11px; }
#screen-menu.is-home .xp-track { height: 3px; width: 72%; }
.home-wallet { min-height: 0; padding: 4px 4px 4px 8px; align-self: center; }
.home-wallet .coin-pill { font-size: 16px; }
.star-plus { width: 28px; height: 28px; border-radius: 8px; font-size: 20px; }
#screen-menu.is-home .player-card {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 36, 64, 0.92), rgba(12, 22, 40, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 8px 18px rgba(0,0,0,0.28);
}
#screen-menu.is-home .avatar-btn {
  width: 38px; height: 38px;
  background: #e23b3b;
  border: 2px solid #f0c43a;
  box-shadow: none;
}
#screen-menu.is-home .avatar-btn svg { width: 70%; height: 70%; }
.home-wallet {
  background: linear-gradient(180deg, rgba(22, 36, 64, 0.92), rgba(12, 22, 40, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  border-radius: 18px;
}
.star-plus { border-radius: 12px; box-shadow: inset 0 1px 0 #fff1b0, 0 4px 10px rgba(240, 196, 58, 0.35); }
.brand-logo { width: min(268px, 82%); margin: 0 auto; }
.brand-logo img {
  border-radius: 0;
  mix-blend-mode: normal;
  -webkit-mask-image: none;
  mask-image: none;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.45));
}
.play-logo {
  width: 78px;
  height: 34px;
  object-fit: cover;
  object-position: center 78%;
  border-radius: 8px;
  flex: 0 0 auto;
  pointer-events: none;
}
#screen-menu.is-home .btn-hero {
  min-height: 64px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff0a6 0%, #f6c73d 46%, #d79a16 100%);
  box-shadow: inset 0 1px 0 #fff6c8, 0 10px 20px rgba(215, 154, 22, 0.4), 0 0 22px rgba(240, 196, 58, 0.22);
}
#screen-menu.is-home .btn-hero:active { transform: translateY(1px) scale(0.985); }
#screen-menu.is-home .btn-hero:active { transform: translateY(1px) scale(0.985); }
.mode-tile {
  position: relative;
  min-height: 90px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 8px 16px rgba(0,0,0,0.32);
}
.mode-tile::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.16);
  pointer-events: none;
}
.mode-lock {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: #f6e7b2;
  stroke-width: 1.6;
}
.mode-crown { width: 42px; height: 30px; filter: drop-shadow(0 3px 3px rgba(0,0,0,0.35)); }
.mode-normal .mode-crown,
.mode-premium .mode-crown,
.mode-vip .mode-crown { color: inherit; }
.mode-fee { max-width: 100%; line-height: 1.15; text-align: center; }
#screen-menu.is-home .mode-card {
  min-height: 52px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 36, 64, 0.94), rgba(12, 24, 44, 0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
.mode-ico { width: 22px; height: 22px; }
.mode-ico.mode-fill { fill: #f0c43a; stroke: none; }
.home-ornament {
  flex: 1 1 auto;
  min-height: 220px;
  height: 260px;
  max-height: 300px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url('home-board.png?v=3');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  mix-blend-mode: normal;
  -webkit-mask-image: none;
  mask-image: none;
}
body.dock-on .home-dock {
  bottom: 8px;
  width: min(420px, calc(100% - 16px));
  border-radius: 22px;
  padding: 6px 4px;
  background: rgba(10, 18, 34, 0.9);
  border: 1px solid rgba(120, 156, 210, 0.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(8px);
}
.dock-btn.active {
  color: #f0c43a;
  background: rgba(240, 196, 58, 0.14);
  border-radius: 16px;
  box-shadow: inset 0 -3px 0 #f0c43a;
}
.dock-btn.active svg { fill: currentColor; }
.dock-btn small { font-size: 10px; }
#screen-menu.is-home .berlin-app {
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
