/* Classic Facebook-era mafia game look: a fixed 760px black canvas, compact
   Verdana text, gold headings, green money and glossy red-orange buttons. */
:root {
  --bg: #000;
  --page: #0a0a0a;
  --panel: #111;
  --panel-2: #1a1a1a;
  --row-alt: #161616;
  --border: #333;
  --border-hi: #4a4a4a;
  --text: #ddd;
  --muted: #999;
  --dim: #666;
  --gold: #ffcc33;
  --gold-dark: #b8860b;
  --money: #66cc33;
  --red: #cc2200;
  --red-hi: #ff4422;
  --health: #e33;
  --energy: #ffcc00;
  --stamina: #3399ff;
  --xp: #ff9900;
  --link: #ffcc66;
  --good-bg: #1d2a12;
  --good-border: #4a7a22;
  --bad-bg: #2a1212;
  --bad-border: #7a2222;
  --fb-blue: #3b5998;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg) radial-gradient(ellipse at top, #1c1c1c 0%, #000 70%) no-repeat;
  color: var(--text);
  font: 11px/1.4 Verdana, Tahoma, 'Lucida Grande', Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; color: #fff; }
button { font-family: inherit; }
input, select {
  font: 11px Verdana, Tahoma, sans-serif;
  background: #000; color: #eee; border: 1px solid #555; padding: 3px 4px;
}
input:focus, select:focus { outline: 1px solid var(--gold-dark); }

/* ------------------------------------------------ old social-network chrome */
.fb-bar {
  background: var(--fb-blue);
  border-bottom: 1px solid #29447e;
  color: #fff;
  height: 30px;
}
.fb-bar-inner {
  width: 760px; margin: 0 auto; display: flex; align-items: center; height: 30px; gap: 16px; padding: 0 4px;
  font: bold 12px 'Lucida Grande', Tahoma, Verdana, sans-serif;
}
.fb-bar-inner .brand { font-size: 15px; letter-spacing: -0.5px; }
.fb-bar-inner .spacer { flex: 1; }
.fb-bar-inner a { color: #fff; font-weight: normal; font-size: 11px; }

.game {
  width: 760px;
  margin: 8px auto 30px;
  background: var(--page);
  border: 1px solid #222;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.8);
}

/* ------------------------------------------------ header & logo */
.header {
  position: relative;
  height: 92px;
  background: linear-gradient(#1b1b1b, #050505);
  border-bottom: 2px solid #3a0a00;
  overflow: hidden;
}
.header .skyline { position: absolute; inset: auto 0 0 0; height: 70px; opacity: 0.85; }
.header .logo { position: absolute; left: 12px; top: 6px; }
.header .header-right { position: absolute; right: 10px; top: 8px; text-align: right; color: var(--muted); }
.header .header-right .who { color: #fff; font-weight: bold; font-size: 12px; }
.header .header-right .class-tag { color: var(--gold); }

/* ------------------------------------------------ stat bar */
.stats {
  display: flex;
  align-items: stretch;
  background: linear-gradient(#2a2a2a, #0d0d0d);
  border-top: 1px solid #444;
  border-bottom: 1px solid #000;
  height: 46px;
}
.stat {
  flex: 1;
  border-right: 1px solid #000;
  box-shadow: inset -1px 0 0 #333;
  padding: 4px 6px 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.stat:last-child { border-right: 0; box-shadow: none; }
.stat .label { font-size: 9px; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; display: flex; align-items: center; gap: 3px; }
.stat .value { font-weight: bold; font-size: 13px; color: #fff; white-space: nowrap; }
.stat .sub { font-size: 9px; color: var(--muted); white-space: nowrap; }
.stat .sub a { font-size: 9px; }
.stat.cash .value { color: var(--money); }
.stat.health .value { color: #ff5544; }
.stat.energy .value { color: var(--energy); }
.stat.stamina .value { color: #66b3ff; }
.stat.level { flex: 1.5; }
.stat.level .value { color: var(--xp); }
.xpbar { height: 6px; background: #000; border: 1px solid #444; margin: 2px 0 1px; }
.xpbar > div { height: 100%; background: linear-gradient(#ffcc33, #cc6600); }

/* ------------------------------------------------ navigation tabs */
.nav {
  display: flex;
  flex-wrap: wrap;
  background: linear-gradient(#5a0d00, #2a0500);
  border-top: 1px solid #8a2a10;
  border-bottom: 1px solid #000;
}
.nav a {
  color: #f2e6d0;
  font-weight: bold;
  padding: 6px 8px 5px;
  white-space: nowrap;
  border-right: 1px solid #1a0300;
  box-shadow: inset -1px 0 0 #6a1a08;
  text-decoration: none;
  font-size: 11px;
  position: relative;
}
.nav a:hover { background: linear-gradient(#7a1a00, #3a0800); color: #fff; }
.nav a.active { background: linear-gradient(#111, #000); color: var(--gold); box-shadow: none; }
.nav { flex-wrap: nowrap; }
/* Notification badges float over the tab's corner so they never push the tabs onto a second line. */
.nav .badge {
  position: absolute; top: 1px; right: 0; margin-left: 0;
  display: inline-block; background: #ff3300; color: #fff; border-radius: 7px; font-size: 9px;
  padding: 0 4px; margin-left: 3px; line-height: 13px; vertical-align: top;
}
.subnav { display: flex; gap: 0; background: #111; border-bottom: 1px solid #333; flex-wrap: wrap; }
.subnav a { padding: 5px 10px; color: var(--muted); font-weight: bold; border-right: 1px solid #222; }
.subnav a.active { color: #fff; background: #222; }
.subnav a.locked { color: #444; }

/* ------------------------------------------------ content */
.content { padding: 10px; min-height: 420px; }
h1.page-title {
  font: bold 18px Georgia, 'Times New Roman', serif;
  color: var(--gold);
  margin: 0 0 8px;
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(255, 160, 0, 0.25);
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}
h2 { font: bold 13px Verdana, sans-serif; color: var(--gold); margin: 12px 0 6px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.money { color: var(--money); font-weight: bold; }
.xp { color: var(--xp); }
.bad { color: #ff5544; }
.good { color: var(--money); }
.gold { color: var(--gold); }
.small { font-size: 9px; }
.right { text-align: right; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: flex-start; }
.grow { flex: 1; min-width: 0; }

.panel { background: var(--panel); border: 1px solid var(--border); margin-bottom: 10px; }
.panel > .panel-title {
  background: linear-gradient(#2e2e2e, #161616);
  border-bottom: 1px solid #000;
  color: #fff;
  font-weight: bold;
  padding: 4px 8px;
  font-size: 11px;
}
.panel > .panel-body { padding: 8px; }

/* Message boxes shown at the top of the page after an action */
.flash { padding: 8px 10px; margin-bottom: 10px; border: 1px solid; display: flex; gap: 10px; align-items: center; }
.flash.good { background: var(--good-bg); border-color: var(--good-border); color: #dfd; }
.flash.bad { background: var(--bad-bg); border-color: var(--bad-border); color: #fdd; }
.flash .title { font-weight: bold; font-size: 12px; }
.flash .close { margin-left: auto; color: #999; cursor: pointer; }

/* ------------------------------------------------ the classic glossy button */
.btn {
  display: inline-block;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 3px 10px;
  font: bold 11px Verdana, sans-serif;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(#ff7a33 0%, #e04a0a 45%, #b52a00 55%, #8a1e00 100%);
  text-shadow: 0 -1px 0 #4a1000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 0 #333;
  white-space: nowrap;
}
.btn:hover { background: linear-gradient(#ff9a55 0%, #f05a1a 45%, #c53a00 55%, #9a2e00 100%); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { background: linear-gradient(#666, #3a3a3a); color: #aaa; cursor: default; text-shadow: none; }
.btn.small { padding: 1px 6px; font-size: 10px; }
.btn.big { padding: 5px 16px; font-size: 13px; }
.btn.gray { background: linear-gradient(#6a6a6a, #3a3a3a 50%, #2a2a2a 51%, #1a1a1a); }
.btn.green { background: linear-gradient(#77cc33, #4a9a11 50%, #3a7a00 51%, #2a5a00); text-shadow: 0 -1px 0 #1a3300; }
.btn.blue { background: linear-gradient(#5a8ad8, #3b5998 50%, #2a4a88 51%, #1a3366); }

/* ------------------------------------------------ tables (jobs, store...) */
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 9px; text-transform: uppercase; color: var(--muted);
  background: #1e1e1e; border-bottom: 1px solid #000; padding: 4px 6px; font-weight: normal; letter-spacing: 0.5px;
}
table.list td { padding: 6px; border-bottom: 1px solid #262626; vertical-align: middle; }
table.list tr:nth-child(even) td { background: var(--row-alt); }
table.list tr.locked td { opacity: 0.45; }
.job-name { font-weight: bold; color: #fff; font-size: 12px; }
.req { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; white-space: nowrap; }
.req.missing { color: #ff5544; }
.mastery { width: 120px; height: 7px; background: #000; border: 1px solid #444; display: inline-block; vertical-align: middle; margin-right: 4px; }
.mastery > div { height: 100%; background: linear-gradient(#ffdd55, #cc8800); }
.medals { display: inline-flex; gap: 2px; vertical-align: middle; }
.medal { width: 12px; height: 12px; border-radius: 6px; border: 1px solid #000; display: inline-block; }
.medal.off { background: #2a2a2a; }
.medal.bronze { background: radial-gradient(circle at 35% 35%, #f0b070, #8a4a14); }
.medal.silver { background: radial-gradient(circle at 35% 35%, #fff, #8a8a8a); }
.medal.gold { background: radial-gradient(circle at 35% 35%, #fff2a0, #b8860b); }

.tier-banner { position: relative; height: 70px; border: 1px solid #333; margin-bottom: 8px; overflow: hidden; }
.tier-banner .tier-text { position: absolute; left: 10px; bottom: 6px; text-shadow: 1px 1px 2px #000; }
.tier-banner .tier-name { font: bold 18px Georgia, serif; color: var(--gold); }

/* ------------------------------------------------ portraits & icons */
.portrait { border: 1px solid #555; background: #222; display: block; }
.icon { display: inline-block; vertical-align: middle; }
.item-icon { border: 1px solid #333; background: #0b0b0b; border-radius: 3px; }
.item-cell { display: flex; gap: 8px; align-items: center; }
.rarity-uncommon { color: #66cc33; }
.rarity-rare { color: #3399ff; }
.rarity-epic { color: #cc66ff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.card { background: var(--panel-2); border: 1px solid #333; padding: 6px; display: flex; gap: 6px; }
.card .card-body { min-width: 0; flex: 1; }
.card .name { font-weight: bold; color: #fff; overflow-wrap: anywhere; line-height: 1.25; }

/* ------------------------------------------------ feed */
.feed-item { padding: 5px 0; border-bottom: 1px solid #222; display: flex; gap: 6px; }
.feed-item .when { color: var(--dim); font-size: 9px; white-space: nowrap; margin-left: auto; padding-left: 8px; }
.feed-dot { width: 8px; height: 8px; border-radius: 4px; margin-top: 3px; flex: none; background: #555; }
.feed-dot.attacked { background: var(--health); }
.feed-dot.level_up, .feed-dot.mastery, .feed-dot.achievement { background: var(--gold); }
.feed-dot.mafia_join, .feed-dot.invite { background: var(--stamina); }
.feed-dot.collection { background: #cc66ff; }

/* ------------------------------------------------ auth screens */
.auth { width: 760px; margin: 0 auto; }
.auth-box { display: flex; gap: 12px; padding: 12px; }
.auth-box .panel { flex: 1; }
.form-row { margin-bottom: 8px; }
.form-row label { display: block; color: var(--muted); margin-bottom: 2px; font-size: 10px; }
.form-row input, .form-row select { width: 100%; padding: 5px; font-size: 12px; }
.class-pick { display: flex; gap: 6px; }
.class-pick label {
  flex: 1; border: 1px solid #333; padding: 6px; background: #161616; cursor: pointer; display: block; color: #ccc;
}
.class-pick label.on { border-color: var(--gold-dark); background: #2a2000; }
.class-pick input { display: none; }

.welcome-back { border: 1px solid #6a5000; background: linear-gradient(#2a2000, #141000); padding: 8px 10px; margin-bottom: 10px; }
.welcome-back h3 { margin: 0 0 4px; color: var(--gold); font: bold 13px Georgia, serif; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.stat-grid div { display: flex; justify-content: space-between; border-bottom: 1px dotted #333; padding: 2px 0; }

.footer { text-align: center; color: var(--dim); font-size: 9px; padding: 8px; border-top: 1px solid #222; }
.admin-tag { background: #552; color: #ffc; padding: 0 4px; font-size: 9px; border-radius: 2px; }
.ai-tag { background: #234; color: #9cf; padding: 0 4px; font-size: 9px; border-radius: 2px; }
pre.json { background: #000; border: 1px solid #333; padding: 6px; overflow: auto; max-height: 300px; font-size: 10px; color: #9c9; }
.spinner { color: var(--muted); padding: 20px; text-align: center; }

@media (max-width: 780px) {
  .game, .fb-bar-inner, .auth { width: auto; margin-left: 4px; margin-right: 4px; }
  .stats { flex-wrap: wrap; height: auto; }
  .stat { flex: 1 1 30%; }
  .auth-box { flex-direction: column; }
}

/* ------------------------------------------------ v0.2 additions */
.tag { font-size: 9px; font-weight: bold; padding: 0 4px; border-radius: 2px; vertical-align: middle; margin-left: 4px; }
.money-tag { background: #1d3a10; color: #8f6; border: 1px solid #3a6a1a; }
.xp-tag { background: #3a2a00; color: #fc6; border: 1px solid #6a4a00; }
.feed-dot.gift { background: #f6c; }
.feed-dot.casino, .feed-dot.announcement { background: #fff; }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal { width: 520px; max-width: 100%; max-height: 85vh; overflow: auto; background: #111; border: 2px solid var(--gold-dark); box-shadow: 0 0 30px #000; }
.modal .modal-title { background: linear-gradient(#3a1a00, #1a0800); color: var(--gold); font: bold 16px Georgia, serif; padding: 8px 12px; border-bottom: 1px solid #000; }
.modal .modal-body { padding: 12px; }
.modal ul { margin: 6px 0; padding-left: 18px; }
.modal li { margin-bottom: 5px; }

.ach-popup { border: 1px solid var(--gold-dark); background: linear-gradient(#2a2000, #120e00); padding: 8px 10px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.ach-badge { width: 38px; height: 38px; border-radius: 19px; flex: none; background: radial-gradient(circle at 35% 35%, #fff2a0, #b8860b); border: 2px solid #5a3a00; display: flex; align-items: center; justify-content: center; color: #3a2000; font-weight: bold; font-size: 18px; }
.ach-badge.off { background: radial-gradient(circle at 35% 35%, #555, #222); border-color: #333; color: #666; }
.progress { height: 7px; background: #000; border: 1px solid #444; }
.progress > div { height: 100%; background: linear-gradient(#ffdd55, #cc8800); }

/* casino */
.felt { background: radial-gradient(ellipse at center, #1f6b35 0%, #0f4020 75%, #0a2a15 100%); border: 6px solid #4a2a10; border-radius: 120px / 60px; padding: 18px 30px; box-shadow: inset 0 0 30px rgba(0,0,0,0.6); color: #eee; }
.felt .seat-label { color: #cfe8c0; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.felt .rules { text-align: center; color: #d8c890; font: italic 11px Georgia, serif; margin: 8px 0; letter-spacing: 1px; }
.cards-row { display: flex; gap: 6px; min-height: 92px; align-items: center; }
.card-face { width: 62px; height: 88px; border-radius: 6px; background: #fff; border: 1px solid #999; box-shadow: 1px 2px 3px rgba(0,0,0,0.5); position: relative; font-family: Georgia, serif; }
.card-face .corner { position: absolute; top: 3px; left: 5px; font-size: 15px; font-weight: bold; line-height: 1; text-align: center; }
.card-face .corner.br { top: auto; left: auto; bottom: 3px; right: 5px; transform: rotate(180deg); }
.card-face .pip { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.card-face.red { color: #c00; }
.card-face.black { color: #111; }
.card-back { width: 62px; height: 88px; border-radius: 6px; border: 3px solid #fff; background: repeating-linear-gradient(45deg, #8a1010 0 5px, #6a0808 5px 10px); box-shadow: 1px 2px 3px rgba(0,0,0,0.5); }
.total-chip { display: inline-block; background: #000; color: #fff; border-radius: 10px; padding: 1px 8px; font-weight: bold; margin-left: 8px; }
.outcome { text-align: center; font: bold 20px Georgia, serif; margin: 6px 0; text-shadow: 1px 1px 2px #000; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { width: 44px; height: 44px; border-radius: 22px; border: 4px dashed #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 10px; cursor: pointer; color: #fff; text-shadow: 0 1px 1px #000; box-shadow: 0 2px 3px #000; }
.chip:hover { transform: translateY(-2px); }
/* Disabled buttons always look disabled, whatever their colour. */
.btn.disabled, .btn:disabled { background: linear-gradient(#666, #3a3a3a) !important; color: #aaa !important; cursor: default; text-shadow: none; }

/* slot machine (v0.3) */
.slot-machine { background: linear-gradient(#5a0a0a, #2a0404); border: 4px solid #b8860b; border-radius: 14px; padding: 12px 16px 14px; box-shadow: inset 0 0 20px #000, 0 4px 10px #000; text-align: center; }
.slot-top { font: bold 20px Georgia, serif; color: #ffd700; letter-spacing: 3px; text-shadow: 0 0 8px #f60, 1px 1px 0 #000; margin-bottom: 8px; }
.slot-window { position: relative; display: inline-flex; gap: 8px; background: #111; padding: 10px; border-radius: 8px; border: 3px solid #333; box-shadow: inset 0 4px 12px #000; }
.slot-reel { width: 96px; height: 96px; background: linear-gradient(#ccc, #fff 30%, #fff 70%, #ccc); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.slot-reel.spinning svg { filter: blur(2px); transform: translateY(4px); }
.payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 2px; background: rgba(220, 0, 0, 0.6); pointer-events: none; }
.slot-result { margin: 10px 0 8px; font: bold 16px Georgia, serif; color: #ddd; min-height: 22px; }
.slot-result.win { color: #ffd700; text-shadow: 0 0 8px #f90; }
.slot-result.lose { color: #bbb; }
.slot-controls .chips { justify-content: center; }
.paytable td { padding: 3px 4px !important; }
.paytable svg { vertical-align: middle; }

/* v0.4 */
.fb-bar .badge { display: inline-block; background: #ff3300; color: #fff; border-radius: 7px; font-size: 9px; padding: 0 4px; margin-left: 3px; line-height: 13px; }
.cap-bar { background: #161616; border: 1px solid #333; padding: 6px 8px; margin-bottom: 10px; }
.cap-bar.full { border-color: var(--bad-border); }
.profile-head { padding-bottom: 8px; margin-bottom: 10px; border-bottom: 2px solid; }
.profile-title { font: italic bold 12px Georgia, serif; margin-bottom: 2px; }
.about-me { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; background: #141414; border-left: 3px solid #444; padding: 4px 8px; }
.showcase { width: 110px; text-align: center; background: #141414; border: 1px solid #333; padding: 6px; }
.hit-form { margin-top: 6px; background: #1a0d0d; border: 1px solid var(--bad-border); padding: 6px; }
.wall-post { align-items: flex-start; }
.wall-text, .chat-text { overflow-wrap: anywhere; white-space: pre-wrap; }
textarea { font: 12px Verdana, sans-serif; background: #000; color: #eee; border: 1px solid #555; padding: 5px; width: 100%; resize: vertical; }
.swatch { width: 34px; height: 34px; border-radius: 4px; display: inline-block; border: 1px solid #000; cursor: pointer; }
.chat-box { height: 380px; overflow-y: auto; background: #0d0d0d; border: 1px solid #333; padding: 6px; }
.chat-line { display: flex; gap: 6px; padding: 4px 2px; border-bottom: 1px solid #1c1c1c; }
.chat-line.mine { background: #15130a; }
.feed-dot.hitlist { background: #f33; box-shadow: 0 0 0 2px #600; }
.feed-dot.robbed { background: #f90; }
.feed-dot.wall { background: #5aa8ff; }

/* roulette */
.r-wheel { width: 74px; height: 74px; border-radius: 37px; border: 6px solid #b8860b; background: #2a1a0a; color: #fff; display: flex; align-items: center; justify-content: center; font: bold 26px Georgia, serif; box-shadow: 0 0 10px #000, inset 0 0 10px #000; }
.r-wheel.red { background: #b01010; } .r-wheel.black { background: #111; } .r-wheel.green { background: #0a7a2a; }
.r-wheel.spinning { animation: rspin 0.4s linear infinite; }
@keyframes rspin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.r-result { font: bold 15px Georgia, serif; color: #ddd; }
.r-result.win { color: #ffd700; }
.r-board { display: grid; grid-template-columns: 44px 1fr 48px; gap: 2px; background: #0f4020; border: 4px solid #4a2a10; padding: 6px; border-radius: 6px; }
.r-zero { grid-row: span 1; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-weight: bold; font-size: 15px; border: 1px solid #cfe8c0; position: relative; background: #0a7a2a; }
.r-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; }
.r-num { height: 34px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; cursor: pointer; border: 1px solid rgba(255,255,255,0.4); position: relative; user-select: none; }
.r-num.red { background: #b01010; } .r-num.black { background: #151515; }
.r-num.hit, .r-zero.hit { outline: 3px solid #ffd700; z-index: 1; }
.r-num:hover, .r-out:hover, .r-zero:hover { filter: brightness(1.3); }
.r-cols { display: grid; grid-template-rows: repeat(3, 34px); gap: 2px; }
.r-dozens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.r-outside { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.r-out { height: 30px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: bold; font-size: 11px; cursor: pointer; border: 1px solid rgba(255,255,255,0.4); position: relative; user-select: none; }
.r-out.red { background: #b01010; } .r-out.black { background: #151515; }
.r-chip { position: absolute; right: 1px; bottom: 1px; background: #ffd700; color: #000; border-radius: 8px; font-size: 9px; padding: 0 3px; line-height: 13px; border: 1px solid #000; }

/* ------------------------------------------------ v0.5 additions */
.rarity-legendary { color: #ff9933; text-shadow: 0 0 4px rgba(255, 140, 0, 0.45); }
.racket-link { color: #ffe9a8 !important; font-weight: bold !important; }
.human-tag { color: var(--gold); margin-left: 4px; font-size: 9px; }
.toggle { display: inline-flex; border: 1px solid #444; border-radius: 3px; overflow: hidden; }
.toggle a { padding: 3px 10px; color: var(--muted); background: #111; font-weight: bold; }
.toggle a.on { background: #3a2a00; color: var(--gold); }
.board-tabs a { padding: 5px 8px; }
.form-grid { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.form-grid > label { color: var(--muted); font-size: 10px; }
.radio { color: #ddd; cursor: pointer; }
.bid-box { display: inline-flex; align-items: center; gap: 3px; }

/* world event banner */
.event-banner { border: 1px solid; padding: 6px 10px; margin-bottom: 8px; font-size: 11px; }
.event-banner.ev-double_xp { background: linear-gradient(#3a2a00, #1a1200); border-color: #b8860b; color: #ffe9a8; }
.event-banner.ev-police_crackdown { background: linear-gradient(#0a1a3a, #050c1c); border-color: #3366cc; color: #cfe0ff; animation: siren 2s linear infinite; }
.event-banner.ev-bounty_frenzy { background: linear-gradient(#3a0a0a, #1a0404); border-color: #aa2222; color: #ffd0d0; }
@keyframes siren { 0%, 100% { box-shadow: inset 4px 0 0 #c22; } 50% { box-shadow: inset 4px 0 0 #36f; } }

/* bosses */
.hp-bar { position: relative; height: 14px; background: #000; border: 1px solid #555; margin-top: 4px; }
.hp-bar > div { height: 100%; transition: width 0.3s; }
.hp-bar > span { position: absolute; inset: 0; text-align: center; font-size: 9px; line-height: 13px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.boss-arena { display: flex; align-items: center; gap: 10px; background: radial-gradient(ellipse at center, #3a0c0c 0%, #120303 80%); border: 2px solid #5a1a0a; padding: 12px; }
.boss-side { flex: 1; text-align: center; min-width: 0; }
.boss-side .portrait, .boss-side svg { margin: 0 auto; }
.boss-name { font: bold 14px Georgia, serif; color: var(--gold); margin-top: 4px; }
.boss-vs { font: bold 26px Georgia, serif; color: #ff5544; text-shadow: 0 0 8px #f00; }
.boss-moves { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.btn.red { background: linear-gradient(#ff4433, #cc1100 50%, #a00800 51%, #6a0400); }
.boss-list { display: flex; flex-direction: column; gap: 6px; }
.boss-card { display: flex; gap: 10px; align-items: center; background: linear-gradient(#1c1010, #120a0a); border: 1px solid #4a2222; padding: 8px; }
.boss-card.locked { opacity: 0.55; background: #121212; border-color: #333; }
.boss-card.tier-boss { margin-top: 8px; }
.boss-action { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 110px; text-align: center; }

/* heists */
.heist-card { border: 1px solid #333; background: #141414; padding: 8px; margin-bottom: 8px; }
.heist-card.success { border-color: var(--good-border); }
.heist-card.failed { border-color: var(--bad-border); }
.heist-roles { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.heist-role { flex: 1 1 90px; min-width: 90px; border: 1px dashed #555; padding: 6px; text-align: center; background: #0d0d0d; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.heist-role.filled { border-style: solid; border-color: #6a5000; background: #1a1500; }
.role-name { font-weight: bold; color: var(--gold); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.heist-plan { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #262626; padding: 8px 0; }
.heist-plan.locked { opacity: 0.6; }
.heist-pick { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; background: #1a1500; border: 1px solid #6a5000; padding: 6px; }

/* the newspaper */
.newspaper { background: #efe6cf; color: #222; padding: 14px 18px; font-family: Georgia, 'Times New Roman', serif; box-shadow: 0 0 0 1px #000, 0 4px 14px #000; background-image: radial-gradient(ellipse at center, #f6efdc 0%, #e4d8b8 100%); }
.newspaper a { color: #6a2a00; text-decoration: underline; }
.np-masthead { text-align: center; border-bottom: 3px double #222; padding-bottom: 6px; margin-bottom: 10px; }
.np-ears { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: 1px; color: #555; }
.np-title { font: bold 40px 'Old English Text MT', 'UnifrakturMaguntia', Georgia, serif; letter-spacing: 1px; line-height: 1.1; }
.np-dateline { font: italic 11px Georgia, serif; border-top: 1px solid #222; margin-top: 4px; padding-top: 3px; }
.np-headline { font: bold 28px Georgia, serif; text-align: center; line-height: 1.1; margin-bottom: 8px; letter-spacing: 0.5px; }
.np-lead-body { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.np-lead-body p { margin: 0; }
.np-lead { border-bottom: 1px solid #222; padding-bottom: 10px; margin-bottom: 10px; }
.np-columns { column-count: 3; column-gap: 18px; column-rule: 1px solid #aaa; }
.np-story { break-inside: avoid; margin-bottom: 10px; font-size: 12px; line-height: 1.4; }
.np-story p { margin: 2px 0 0; text-align: justify; }
.np-subhead { font: bold 13px Georgia, serif; letter-spacing: 0.5px; border-bottom: 1px solid #555; }
.np-numbers { border-top: 3px double #222; margin-top: 6px; padding-top: 6px; }
.np-number-row { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 8px; margin-top: 4px; text-align: center; }
.np-number-row div { display: flex; flex-direction: column; }
.np-number-row b { font-size: 18px; }
.np-number-row span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }

/* casino: jackpot, roulette history, high rollers */
.jackpot-meter { display: inline-flex; flex-direction: column; background: #000; border: 2px solid #b8860b; border-radius: 6px; padding: 3px 14px; margin-bottom: 8px; }
.jackpot-meter span { font-size: 9px; color: #f90; letter-spacing: 2px; }
.jackpot-meter b { font: bold 20px 'Courier New', monospace; color: #ff3b30; text-shadow: 0 0 6px #f00; letter-spacing: 1px; }
.r-history { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.r-hist { width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: bold; border: 1px solid #000; }
.r-hist.red { background: #b01010; } .r-hist.black { background: #222; } .r-hist.green { background: #0a7a2a; }
.r-hist.latest { outline: 2px solid #ffd700; }
.high-roller-holder { display: flex; gap: 8px; align-items: center; background: #1a1500; border: 1px solid #6a5000; padding: 6px; margin-bottom: 6px; }
.high-roller-crown { font-size: 16px; }

/* achievements: tiered badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.badge-card { display: flex; gap: 8px; align-items: flex-start; background: #161616; border: 1px solid #333; padding: 6px; }
.badge-card.none { opacity: 0.75; }
.badge-card.secret.found { border-color: #6a3a8a; background: #170f1c; }
.badge-medal { flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #3a2000; border: 2px solid #000; }
.badge-medal.bronze { background: radial-gradient(circle at 35% 35%, #f0b070, #8a4a14); }
.badge-medal.silver { background: radial-gradient(circle at 35% 35%, #fff, #8a8a8a); }
.badge-medal.gold { background: radial-gradient(circle at 35% 35%, #fff2a0, #b8860b); }
.badge-medal.star { background: radial-gradient(circle at 35% 35%, #ffe08a, #c06000); }
.badge-medal.secret { background: radial-gradient(circle at 35% 35%, #e0a0ff, #5a1a8a); color: #fff; }
.badge-medal.off { background: radial-gradient(circle at 35% 35%, #555, #222); color: #777; }
.tier-dots { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tier-dot { font-size: 9px; padding: 0 5px; border: 1px solid #333; border-radius: 8px; color: #555; }
.tier-dot.got.t-bronze { color: #e8a060; border-color: #8a4a14; }
.tier-dot.got.t-silver { color: #eee; border-color: #888; }
.tier-dot.got.t-gold { color: #ffd84a; border-color: #b8860b; }
.t-bronze { color: #e8a060; } .t-silver { color: #ddd; } .t-gold { color: #ffd84a; }
.pin { margin-left: 4px; font-size: 9px; opacity: 0.6; }
.pin.on { opacity: 1; color: var(--gold); }
.pinned-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pinned-badge { display: inline-flex; align-items: center; gap: 4px; background: #1a1500; border: 1px solid #6a5000; border-radius: 12px; padding: 1px 8px 1px 2px; font-size: 10px; color: #ffe9a8; }
.feed-dot.boss { background: #f33; }
.feed-dot.heist, .feed-dot.heist_invite { background: #6c6; }
.feed-dot.market { background: #fc6; }
.feed-dot.world_event, .feed-dot.newspaper, .feed-dot.high_roller { background: #fff; }

/* ------------------------------------------------ phones and small screens (v0.5)
   Everything below only applies on narrow screens; the desktop layout is unchanged. */
@media (max-width: 780px) {
  body { background: #000; }
  .game { width: auto; margin: 0; border: 0; box-shadow: none; }
  .fb-bar { height: auto; }
  .fb-bar-inner { width: auto; margin: 0; gap: 12px; height: 32px; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
  .fb-bar-inner::-webkit-scrollbar, .nav::-webkit-scrollbar, .subnav::-webkit-scrollbar { display: none; }
  .fb-bar-inner .brand { font-size: 13px; white-space: nowrap; }
  .fb-bar-inner .spacer { display: none; }
  .fb-bar-inner a { white-space: nowrap; font-size: 12px; padding: 6px 0; }

  .header { height: 62px; }
  .header .logo { width: 190px; height: auto; left: 6px; top: 6px; }
  .header .header-right { right: 6px; top: 6px; font-size: 10px; }
  .header .header-right .portrait { width: 40px; height: 40px; }

  /* Stat bar: two rows of compact boxes */
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; }
  .stat { border-bottom: 1px solid #000; padding: 4px 6px; }
  .stat.level { grid-column: span 2; }
  .stat .value { font-size: 14px; }
  .stat .sub, .stat .sub a { font-size: 10px; }

  /* Menu: a tab bar you can swipe, stuck to the top of the screen */
  .nav { position: sticky; top: 0; z-index: 30; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav a { padding: 10px 11px 9px; font-size: 12px; }
  .nav .badge { top: 2px; right: 1px; }
  .subnav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .subnav a { padding: 9px 12px; white-space: nowrap; font-size: 12px; }

  .content { padding: 8px 8px 16px; }
  h1.page-title { font-size: 17px; }

  /* Bigger touch targets; 16px inputs stop phones from zooming in when you type */
  .btn { padding: 6px 12px; font-size: 12px; }
  .btn.small { padding: 4px 9px; font-size: 11px; }
  .btn.big { padding: 8px 16px; font-size: 14px; }
  input, select, textarea { font-size: 16px; padding: 6px; }
  a { -webkit-tap-highlight-color: rgba(255, 204, 51, 0.25); }

  /* Side-by-side layouts stack: fixed-width side columns go full width */
  .row { flex-wrap: wrap; }
  .row > div[style*="width"] { width: 100% !important; flex: 1 1 100%; }
  .casino-split > .grow { flex: 1 1 100%; }
  .profile-head { flex-wrap: wrap; }
  .profile-head > div:first-child .portrait { width: 84px; height: 84px; }
  .showcase { width: auto; display: flex; gap: 8px; align-items: center; text-align: left; }

  /* Wide tables turn into a card per row */
  table.list.stack, table.list.stack tbody { display: block; }
  table.list.stack thead { display: none; }
  table.list.stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 4px; border-bottom: 1px solid #2a2a2a; }
  table.list.stack tr:nth-child(even) { background: var(--row-alt); }
  table.list.stack td { display: block; border: 0; padding: 0; background: none !important; width: auto !important; }
  table.list.stack td:last-child { margin-left: auto; }
  table.list.jobs-table td:first-child { flex: 1 1 100%; }
  table.list.jobs-table td:nth-child(2) { display: flex; gap: 8px; }
  table.list.market-table td:nth-child(2) { flex: 1 1 50%; }
  .mastery { width: 90px; }

  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .stat-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: 1fr; }
  .feed-item { flex-wrap: wrap; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { width: 100%; }

  /* Casino */
  .felt { padding: 12px 10px; border-radius: 40px / 24px; border-width: 4px; }
  .card-face, .card-back { width: 50px; height: 72px; }
  .card-face .pip { font-size: 24px; }
  .cards-row { min-height: 76px; flex-wrap: wrap; }
  .slot-machine { padding: 10px 8px; }
  .slot-reel { width: 78px; height: 78px; }
  .slot-reel svg { width: 62px; height: 62px; }
  .r-board { grid-template-columns: 26px 1fr 30px; padding: 3px; border-width: 3px; }
  .r-num { height: 30px; font-size: 10px; }
  .r-cols { grid-template-rows: repeat(3, 30px); }
  .r-out { font-size: 9px; height: 30px; }
  .r-zero { font-size: 12px; }
  .chip { width: 40px; height: 40px; }

  /* Bosses, heists, newspaper */
  .boss-arena { padding: 8px 4px; gap: 4px; }
  .boss-arena .portrait { width: 64px; height: 64px; }
  .boss-vs { font-size: 18px; }
  .boss-card { flex-wrap: wrap; }
  .boss-action { width: auto; flex-direction: row; margin-left: auto; }
  .heist-plan { flex-wrap: wrap; }
  .heist-plan > .btn { margin-left: auto; }
  .newspaper { padding: 10px; }
  .np-title { font-size: 28px; }
  .np-headline { font-size: 21px; }
  .np-columns { column-count: 1; }
  .np-lead-body { font-size: 13px; }

  .chat-box { height: 55vh; }
  .auth .panel { margin: 0; }
}

@media (max-width: 360px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat.level { grid-column: span 2; }
  .header .logo { width: 150px; }
  .nav a { padding: 10px 9px 9px; }
  .r-num { font-size: 9px; }
}

/* Most Wanted posters (Hitlist) */
.wanted-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.wanted-poster { width: 150px; background: linear-gradient(#e9d9b0, #cdb47c); color: #3a2410; text-align: center; padding: 8px 6px; border: 1px solid #6a4a20; box-shadow: 2px 3px 6px #000; cursor: pointer; font-family: Georgia, serif; transform: rotate(-1deg); }
.wanted-poster:nth-child(2) { transform: rotate(1.5deg); }
.wanted-poster .portrait { margin: 4px auto; filter: sepia(0.6); border-color: #6a4a20; }
.wp-head { font: bold 22px Georgia, serif; letter-spacing: 3px; }
.wp-name { font-weight: bold; font-size: 12px; overflow-wrap: anywhere; }
.wp-sub { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; }
.wp-reward { font: bold 15px Georgia, serif; color: #7a1a00; margin-top: 2px; }
@media (max-width: 780px) { .wanted-poster { width: 108px; } .wp-head { font-size: 16px; } }

/* ---------------------------------------------------------------- v0.6: territory */
.territory-top { gap: 12px; align-items: flex-start; }
.map-wrap { flex: 0 0 auto; }
.nyc-map { display: block; border: 2px solid #000; box-shadow: 0 0 0 1px var(--gold-dark); max-width: 100%; height: auto; }
.nyc-map .borough:hover path { filter: brightness(1.25); }
.borough-panel { min-width: 0; }
.borough-owner { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--border); padding: 6px; }
.illegal-tag { background: #600; color: #fcc; }
.legal-tag { background: #234; color: #9cf; }
.feed-dot.turf, .feed-dot.turf_held { background: #c90; }
.feed-dot.turf_lost { background: #a33; }
.feed-dot.race { background: #8c4; }
.feed-dot.revenge { background: #f30; box-shadow: 0 0 0 2px #600; }
.feed-dot.like { background: #f69; }
.feed-dot.mention { background: #5aa8ff; }
.feed-dot.poker { background: #3a3; }

/* ---------------------------------------------------------------- v0.6: Hold'em */
.poker-lobby { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.poker-lobby .panel { margin: 0 0 8px; }
.poker-lobby-table.locked { opacity: 0.6; }
.poker-felt { position: relative; height: 430px; margin: 6px 0 10px; border-radius: 200px; background: radial-gradient(ellipse at center, #1f7a35 0%, #0f5a22 60%, #0a3a16 100%); border: 14px solid #4a2a10; box-shadow: inset 0 0 30px #000, 0 0 0 2px #000, 0 6px 20px #000; }
.poker-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.poker-board { justify-content: center; min-height: 0; }
.poker-board .card-face, .poker-board .card-back, .card-slot { width: 46px; height: 66px; }
.poker-board .card-face .pip { font-size: 22px; }
.poker-board .card-face .corner { font-size: 12px; }
.card-slot { border: 1px dashed rgba(255, 255, 255, 0.25); border-radius: 6px; }
.poker-pot { margin-top: 6px; font: bold 13px Georgia, serif; background: rgba(0, 0, 0, 0.5); display: inline-block; padding: 2px 10px; border-radius: 10px; }
.poker-seat { position: absolute; width: 150px; background: rgba(0, 0, 0, 0.72); border: 1px solid #333; border-radius: 6px; padding: 4px; font-size: 11px; }
.poker-seat.p0 { left: 50%; bottom: -10px; transform: translateX(-50%); }
.poker-seat.p1 { left: 6px; bottom: 40px; }
.poker-seat.p2 { left: 6px; top: 20px; }
.poker-seat.p3 { left: 50%; top: -10px; transform: translateX(-50%); }
.poker-seat.p4 { right: 6px; top: 20px; }
.poker-seat.p5 { right: 6px; bottom: 40px; }
.poker-seat.acting { border-color: var(--gold); box-shadow: 0 0 10px var(--gold); }
.poker-seat.folded { opacity: 0.5; }
.poker-seat.winner { border-color: #6f6; box-shadow: 0 0 12px #6f6; }
.seat-top { display: flex; gap: 5px; align-items: center; }
.seat-info { min-width: 0; }
.seat-name { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 104px; }
.seat-cards { display: flex; gap: 3px; margin-top: 3px; min-height: 0; }
.seat-cards .card-face, .seat-cards .card-back { width: 34px; height: 48px; border-width: 1px; }
.seat-cards .card-face .pip { font-size: 16px; }
.seat-cards .card-face .corner { font-size: 10px; }
.seat-cards .card-face .corner.br { display: none; }
.seat-status { margin-top: 2px; min-height: 13px; text-transform: capitalize; }
.seat-bet { color: var(--money); font-weight: bold; text-transform: none; }
.seat-timer { color: var(--gold); font-weight: bold; }
.dealer-btn { display: inline-block; background: #fff; color: #000; border-radius: 50%; width: 14px; height: 14px; line-height: 14px; text-align: center; font-size: 9px; margin-left: 4px; }
.empty-seat { color: #666; text-align: center; padding: 10px 0; font-style: italic; }
.raise-slider { width: 160px; }
.poker-log { max-height: 180px; overflow: auto; font-size: 11px; line-height: 1.5; }

/* ---------------------------------------------------------------- v0.6: horse race */
.race-header { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(#1a3a1a, #0a1a0a); border: 1px solid #2a4a2a; padding: 8px 12px; margin-bottom: 8px; }
.race-track { font: bold 18px Georgia, serif; color: var(--gold); }
.race-countdown { font-size: 14px; }
.race-card tr.selected td { background: #2a2a10; }
.mono { font-family: Consolas, monospace; letter-spacing: 1px; }
.silks { vertical-align: middle; }
.race-track-view { position: relative; background: #3a2a14; border: 2px solid #2a1a08; padding: 4px 0; }
.lane { display: flex; align-items: center; height: 26px; border-bottom: 1px dashed rgba(255, 255, 255, 0.15); }
.lane-no { width: 18px; text-align: center; color: #fff; font-weight: bold; font-size: 10px; }
.lane-track { position: relative; flex: 1; height: 100%; margin-right: 8px; }
.runner { position: absolute; top: 2px; display: flex; align-items: center; white-space: nowrap; }
.horse-emoji { font-size: 18px; transform: scaleX(-1); display: inline-block; }
.lane-name { width: 150px; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finish-line { position: absolute; top: 0; bottom: 0; right: 158px; width: 4px; background: repeating-linear-gradient(#fff 0 4px, #000 4px 8px); }

/* ---------------------------------------------------------------- v0.6: likes, mentions, patch notes */
.like-btn { color: var(--muted); }
.like-btn.liked { color: #f69; }
.mention { color: #5aa8ff; font-weight: bold; }
.mention.me { background: #5aa8ff; color: #000; padding: 0 2px; border-radius: 2px; }
.chat-line.mentions-me { background: rgba(90, 168, 255, 0.12); border-left: 3px solid #5aa8ff; }
.mention-menu { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mention-menu a { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border-hi); padding: 2px 6px; color: var(--text); }
.login-news { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; background: linear-gradient(#2a1a00, #140a00); border: 1px solid var(--gold-dark); padding: 6px 10px; margin-bottom: 8px; }
.patch-entry { border-bottom: 1px solid var(--border); padding: 6px 0; }
.patch-head { display: flex; justify-content: space-between; gap: 8px; color: var(--text); }

@media (max-width: 780px) {
  .territory-top { flex-direction: column; }
  .map-wrap { width: 100%; }
  .nyc-map { width: 100%; }
  .poker-lobby { grid-template-columns: 1fr; }
  .poker-felt { height: auto; border-radius: 24px; border-width: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
  .poker-center { position: static; transform: none; grid-column: 1 / -1; order: -1; }
  .poker-seat, .poker-seat.p0, .poker-seat.p1, .poker-seat.p2, .poker-seat.p3, .poker-seat.p4, .poker-seat.p5 { position: static; transform: none; width: auto; min-width: 0; }
  .poker-seat.p0 { grid-column: 1 / -1; order: 10; }
  .seat-name { max-width: 100px; }
  .raise-slider { width: 100%; }
  .race-header { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lane-name { width: 90px; }
  .finish-line { right: 98px; }
}

/* ---------------------------------------------------------------- v0.7: effects layer */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fx-float { position: absolute; transform: translate(-50%, -50%); font: bold 17px Georgia, serif; white-space: nowrap; text-shadow: 0 0 3px #000, 0 2px 2px #000; animation: fxFloat 1.5s ease-out both; }
.fx-cash { color: #8f4; } .fx-loss { color: #ff5a4a; } .fx-xp { color: #ffcc33; } .fx-gold { color: #ffe27a; } .fx-bad { color: #f66; }
@keyframes fxFloat { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 15% { opacity: 1; transform: translate(-50%, -70%) scale(1.15); } 30% { transform: translate(-50%, -90%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -260%); } }
.fx-coins { position: absolute; }
.fx-coin { position: absolute; width: 13px; height: 13px; margin: -6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6b0, #e8b400 50%, #8a6000); border: 1px solid #6a4a00; animation: fxCoin 1.3s cubic-bezier(0.2, 0.7, 0.4, 1) both; }
@keyframes fxCoin { 0% { transform: translate(0, 0) scale(0.4); opacity: 0; } 10% { opacity: 1; } 55% { transform: translate(var(--dx), var(--dy)) scale(1) rotateY(180deg); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 110px)) scale(0.9) rotateY(360deg); opacity: 0; } }
.fx-levelup { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: auto; cursor: pointer; animation: lvlBg 3.2s ease-out both; }
@keyframes lvlBg { 0% { background: rgba(255, 220, 120, 0.55); } 12% { background: rgba(0, 0, 0, 0.35); } 85% { opacity: 1; } 100% { background: rgba(0, 0, 0, 0); opacity: 0; } }
.fx-rays { position: absolute; animation: lvlRays 3.2s linear both; }
@keyframes lvlRays { 0% { transform: scale(0.2) rotate(0deg); opacity: 0; } 15% { transform: scale(1.1) rotate(30deg); opacity: 1; } 85% { opacity: 0.9; } 100% { transform: scale(1.3) rotate(150deg); opacity: 0; } }
.fx-levelup-text { position: relative; text-align: center; animation: lvlText 3.2s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes lvlText { 0% { transform: scale(0.2); opacity: 0; } 14% { transform: scale(1); opacity: 1; } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.fx-levelup-title { font: bold 46px Georgia, serif; color: #ffd84a; letter-spacing: 2px; -webkit-text-stroke: 2px #5a2a00; text-shadow: 0 0 18px #ff9a1a, 0 4px 0 #3a1a00; }
.fx-levelup-num { font: bold 84px Georgia, serif; color: #fff; -webkit-text-stroke: 3px #7a3a00; text-shadow: 0 0 24px #ffcc33, 0 5px 0 #3a1a00; line-height: 1; }

/* stat bar */
.xpbar > div { transition: width 0.7s ease-out; }
.stat.cash.pulse .value { animation: statPulse 0.7s ease-out; }
@keyframes statPulse { 0% { text-shadow: 0 0 0 #8f4; } 30% { text-shadow: 0 0 10px #8f4; color: #cfa; } 100% { text-shadow: 0 0 0 transparent; } }
.stat.energy.full .value { animation: energyGlow 1.6s ease-in-out infinite alternate; }
@keyframes energyGlow { from { text-shadow: 0 0 0 transparent; } to { text-shadow: 0 0 8px #ffd400, 0 0 2px #ffd400; color: #fff4b0; } }
.stat.level.leveled .level-num { display: inline-block; animation: levelPop 1.2s cubic-bezier(0.3, 1.8, 0.5, 1); color: #ffd84a; }
@keyframes levelPop { 0% { transform: scale(1); } 30% { transform: scale(1.8); } 100% { transform: scale(1); } }
.stat.level.leveled .xpbar { animation: xpFlash 1.2s ease-out; }
@keyframes xpFlash { 0%, 40% { box-shadow: 0 0 10px #ffcc33; border-color: #ffcc33; } 100% { box-shadow: none; } }

/* buttons and panels */
.btn { transition: transform 0.06s, filter 0.1s; }
.btn:active { transform: translateY(2px) scale(0.97); filter: brightness(0.9); }
.panel, .flash, .ach-popup { animation: panelIn 0.28s ease-out both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* fights */
.clash { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0 8px; padding: 8px; background: radial-gradient(ellipse at center, rgba(120, 20, 0, 0.35), transparent 70%); }
.clash-side { text-align: center; width: 110px; transition: filter 0.4s, opacity 0.4s, transform 0.4s; }
.clash-portrait { position: relative; display: inline-block; }
.clash-side.hit .clash-portrait, .boss-side.hit .clash-portrait { animation: shake 0.32s; }
@keyframes shake { 0%, 100% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(-6px, 2px) rotate(-4deg); } 40% { transform: translate(5px, -2px) rotate(3deg); } 60% { transform: translate(-4px, 1px) rotate(-2deg); } 80% { transform: translate(3px, 0) rotate(1deg); } }
.clash-flash { position: absolute; inset: 0; background: #fff; mix-blend-mode: screen; animation: hitFlash 0.25s ease-out both; pointer-events: none; }
@keyframes hitFlash { from { opacity: 0.85; } to { opacity: 0; } }
.clash-dmg { position: absolute; top: -8px; right: -14px; font: bold 18px Georgia, serif; color: #ff3a2a; text-shadow: 0 0 3px #000, 0 2px 0 #000; animation: dmgPop 0.8s ease-out both; pointer-events: none; }
@keyframes dmgPop { 0% { transform: scale(0.4); opacity: 0; } 20% { transform: scale(1.4); opacity: 1; } 100% { transform: translateY(-22px) scale(1); opacity: 0; } }
.clash-side.winner .clash-portrait { box-shadow: 0 0 0 2px #ffcc33, 0 0 16px #ffcc33; }
.clash-side.loser { filter: grayscale(0.8) brightness(0.7); transform: rotate(-4deg) translateY(4px); }
.clash-name { font-size: 10px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clash-hp { height: 5px; background: #300; border: 1px solid #555; margin-top: 3px; }
.clash-hp > div { height: 100%; background: linear-gradient(#5c5, #282); transition: width 0.25s; }
.clash-vs { font: bold 20px Georgia, serif; color: #aaa; min-width: 70px; text-align: center; }
.clash-vs.won { color: #8f4; animation: vsPop 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
.clash-vs.lost { color: #f55; animation: vsPop 0.5s ease-out; }
@keyframes vsPop { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.boss-side .clash-portrait .clash-dmg { font-size: 22px; }

/* cards */
.deal-in { animation: dealIn 0.38s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
@keyframes dealIn { from { transform: translate(140px, -110px) rotate(28deg) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
.flip-in { animation: flipIn 0.42s ease-out both; }
@keyframes flipIn { 0% { transform: perspective(300px) rotateY(90deg); } 100% { transform: perspective(300px) rotateY(0); } }

/* slots */
.slot-reel { position: relative; }
.reel-strip { display: flex; flex-direction: column; align-items: center; gap: 13px; animation: reelRoll 0.18s linear infinite; filter: blur(1.5px); }
@keyframes reelRoll { from { transform: translateY(-62%); } to { transform: translateY(0); } }
.slot-reel.spinning .reel-strip svg { filter: none; transform: none; }
.slot-reel.landed svg { animation: reelLand 0.38s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes reelLand { 0% { transform: translateY(-18px); } 60% { transform: translateY(5px); } 100% { transform: none; } }
.slot-machine.party-win { animation: machineWin 0.35s ease-in-out 6 alternate; }
@keyframes machineWin { from { box-shadow: 0 0 0 0 #ffcc33; } to { box-shadow: 0 0 22px 4px #ffcc33; } }
.slot-machine.party-jackpot { animation: machineJackpot 0.25s linear 16; }
@keyframes machineJackpot { 0% { box-shadow: 0 0 26px 6px #ff3a3a; } 33% { box-shadow: 0 0 26px 6px #ffcc33; } 66% { box-shadow: 0 0 26px 6px #3af; } 100% { box-shadow: 0 0 26px 6px #ff3a3a; } }

/* roulette */
.r-wheel-wrap { position: relative; width: 150px; height: 150px; flex: none; margin-right: 10px; }
.r-wheel-svg { display: block; filter: drop-shadow(0 3px 6px #000); }
.r-wheel-wrap .r-wheel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-width: 3px; font-size: 17px; pointer-events: none; }
.r-wheel-wrap .r-wheel.blank { opacity: 0.7; }
.r-wheel-wrap .r-wheel.shown { animation: numPop 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes numPop { from { transform: translate(-50%, -50%) scale(0.3); } to { transform: translate(-50%, -50%) scale(1); } }

/* poker */
.pot-chips { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.pot-chips i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; border: 2px dashed #fff; background: #a01010; animation: chipArrive 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.pot-chips i:nth-child(2) { background: #222; animation-delay: 0.08s; left: 8px; }
.pot-chips i:nth-child(3) { background: #2a6ad8; animation-delay: 0.16s; left: -8px; }
@keyframes chipArrive { 0% { transform: translate(var(--fx, 0), var(--fy, -160px)); opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(0, 0); opacity: 0; } }
.poker-seat.p0 { --fx: 0px; --fy: -170px; } .poker-seat.p1 { --fx: 260px; --fy: -90px; } .poker-seat.p2 { --fx: 260px; --fy: 120px; }
.poker-seat.p3 { --fx: 0px; --fy: 170px; } .poker-seat.p4 { --fx: -260px; --fy: 120px; } .poker-seat.p5 { --fx: -260px; --fy: -90px; }
.poker-seat.acting { animation: actingGlow 1s ease-in-out infinite alternate; }
@keyframes actingGlow { from { box-shadow: 0 0 4px var(--gold); } to { box-shadow: 0 0 14px var(--gold); } }

/* territory */
.nyc-map .borough.attacking path:not([filter]) { animation: boroughPulse 0.45s ease-in-out infinite alternate; }
@keyframes boroughPulse { from { filter: brightness(1); stroke: #000; } to { filter: brightness(1.6) saturate(1.5); stroke: #ff3a2a; stroke-width: 3; } }
.nyc-map .borough.captured path:not([filter]) { animation: captureFill 1.6s ease-out; }
@keyframes captureFill { 0% { filter: brightness(2.6) saturate(0); } 30% { filter: brightness(1.8) saturate(2); } 100% { filter: none; } }

/* races */
.race-track-view.running .horse-emoji { animation: gallop 0.3s ease-in-out infinite alternate; }
@keyframes gallop { from { transform: scaleX(-1) translateY(0) rotate(0); } to { transform: scaleX(-1) translateY(-3px) rotate(-5deg); } }

/* achievements */
.ach-badge { position: relative; overflow: hidden; }
.medal-drop { animation: medalDrop 0.75s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes medalDrop { 0% { transform: translateY(-40px) rotate(-30deg) scale(0.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
.medal-drop::after { content: ''; position: absolute; top: -10px; left: -30px; width: 16px; height: 60px; background: rgba(255, 255, 255, 0.75); transform: rotate(25deg); animation: medalShine 1.2s ease-in-out 0.7s both; }
@keyframes medalShine { from { left: -30px; } to { left: 50px; } }

/* options page and speaker */
.speaker { font-size: 14px; cursor: pointer; margin-left: 4px; text-decoration: none !important; }
.nav .speaker { padding: 4px 10px; align-self: center; }
.opt-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #1d1d1d; }
.opt-row:last-child { border-bottom: 0; }
.opt-label { flex: 1; min-width: 0; }
.opt-row input[type='range'] { flex: 1; max-width: 260px; accent-color: var(--gold); }
.opt-val { width: 38px; text-align: right; color: var(--muted); }
.opt-toggle input { width: 16px; height: 16px; accent-color: var(--gold); flex: none; }
.opt-radio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opt-radio label { border: 1px solid var(--border); padding: 6px; cursor: pointer; }
.opt-radio label.on { border-color: var(--gold); background: #1a1400; }
.sound-grid { display: flex; flex-wrap: wrap; gap: 4px; }

/* reduced and no motion */
.motion-reduced .clash-side.hit .clash-portrait, .motion-reduced .boss-side.hit .clash-portrait, .motion-reduced .clash-flash,
.motion-reduced .fx-rays, .motion-reduced .slot-machine[class*='party'], .motion-reduced .nyc-map .borough path,
.motion-reduced .stat.energy.full .value, .motion-reduced .poker-seat.acting, .motion-reduced .race-track-view.running .horse-emoji,
.motion-reduced .reel-strip, .motion-reduced .medal-drop::after { animation: none !important; }
.motion-reduced .deal-in, .motion-reduced .flip-in, .motion-reduced .medal-drop, .motion-reduced .fx-levelup-text, .motion-reduced .slot-reel.landed svg { animation-name: fadeIn !important; }
.motion-reduced .fx-levelup { animation-name: fadeIn; animation-direction: reverse; }
.motion-reduced .clash-side.loser { transform: none; }
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition: none !important; }

@media (max-width: 780px) {
  .clash { gap: 8px; }
  .clash-side { width: 84px; }
  .clash-vs { min-width: 50px; font-size: 16px; }
  .fx-levelup-title { font-size: 34px; }
  .fx-levelup-num { font-size: 64px; }
  .fx-rays { width: 300px; height: 300px; }
  .poker-seat { position: relative; }
  .poker-seat.p0, .poker-seat.p1, .poker-seat.p2, .poker-seat.p3, .poker-seat.p4, .poker-seat.p5 { --fx: 0px; --fy: -110px; position: relative; }
  .opt-radio { grid-template-columns: 1fr; }
  .opt-row input[type='range'] { max-width: none; }
  .r-wheel-wrap { width: 120px; height: 120px; }
  .r-wheel-svg { width: 120px; height: 120px; }
}
.pop-in { animation: vsPop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.motion-reduced .pop-in { animation-name: fadeIn !important; }
