:root {
  color-scheme: dark;
  --felt: #0b654b;
  --felt-deep: #064331;
  --felt-dark: #032b21;
  --gold: #e8b94f;
  --gold-soft: #f4d98a;
  --cream: #fff8e8;
  --cream-dark: #d8cbaa;
  --ink: #17342d;
  --red: #dc4b45;
  --blue: #377fd4;
  --yellow: #d49c14;
  --black: #273039;
  --panel: rgba(2, 36, 27, 0.87);
  --line: rgba(255, 255, 255, 0.13);
  --shadow: 0 14px 35px rgba(0, 20, 15, 0.34);
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #04291f;
}

body {
  color: white;
  overscroll-behavior: none;
  user-select: none;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
  filter: grayscale(0.55);
  opacity: 0.48;
}

.hidden {
  display: none !important;
}

.screen {
  width: 100vw;
  height: 100dvh;
}

.home-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  padding: max(28px, env(safe-area-inset-top))
    max(44px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(44px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 18% 18%, rgba(240, 195, 85, 0.16), transparent 27%),
    radial-gradient(circle at 84% 76%, rgba(81, 201, 158, 0.18), transparent 30%),
    linear-gradient(135deg, #063e30 0%, #07563f 48%, #032b21 100%);
}

.home-screen::before,
.home-screen::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.home-screen::before {
  width: 400px;
  height: 400px;
  left: -190px;
  bottom: -230px;
}

.home-screen::after {
  width: 280px;
  height: 280px;
  right: -100px;
  top: -130px;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
  z-index: 1;
}

.brand-mark {
  position: relative;
  display: grid;
  width: clamp(118px, 17vw, 190px);
  aspect-ratio: 0.78;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 8px solid #e3d7b9;
  border-radius: 26px;
  background: linear-gradient(145deg, #fffaf0, #e9ddc3);
  box-shadow: 0 26px 50px rgba(0, 24, 18, 0.4);
  transform: rotate(-4deg);
}

.brand-mark::before {
  position: absolute;
  inset: 8px;
  border: 2px solid #c9b991;
  border-radius: 16px;
  content: "";
}

.brand-mark span {
  color: #07563f;
  font-size: clamp(48px, 8vw, 88px);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand-mark i {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 22px;
  top: 22px;
  border-radius: 50%;
  background: var(--red);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

h1,
h2,
p {
  margin-top: 0;
}

.brand-card h1 {
  max-width: 500px;
  margin-bottom: 10px;
  font-size: clamp(34px, 5.3vw, 70px);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.subtitle {
  max-width: 470px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(13px, 1.65vw, 19px);
  line-height: 1.5;
}

.home-actions {
  display: grid;
  gap: 13px;
  z-index: 1;
}
.nickname-field { display:grid; gap:5px; }
.nickname-field span { color:rgba(255,255,255,.58); font-size:9px; font-weight:800; }
.nickname-field input { width:100%; height:42px; padding:0 14px; border:1px solid rgba(255,255,255,.15); border-radius:13px; outline:0; color:white; background:rgba(2,32,24,.58); font:inherit; }
.identity-row { display:grid; grid-template-columns:minmax(0,1fr) 128px; align-items:end; gap:7px; }
.account-button { display:grid; height:42px; align-content:center; gap:2px; padding:5px 9px; border:1px solid rgba(244,206,105,.25); border-radius:13px; background:rgba(244,206,105,.09); text-align:left; }
.account-button small { color:var(--gold-soft); font-size:7px; font-weight:900; }
.account-button strong { overflow:hidden; font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.account-button.member { border-color:rgba(83,205,158,.42); background:rgba(42,153,111,.14); }
.account-button.member small { color:#baf3db; }
.connection-badge { max-width:105px; overflow:hidden; padding:4px 7px; border:1px solid rgba(255,255,255,.1); border-radius:8px; color:rgba(255,255,255,.54); font-size:7px; white-space:nowrap; }
.connection-badge.online { color:#baf3db; }

.primary-action,
.secondary-action {
  display: flex;
  width: 100%;
  min-height: 84px;
  align-items: center;
  gap: 15px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 120ms ease, filter 120ms ease;
}

.primary-action:active,
.secondary-action:active,
.tool-button:active {
  transform: scale(0.975);
}

.primary-action {
  color: #17342d;
  background: linear-gradient(135deg, #f4ce69, #e7aa37);
}

.secondary-action {
  background: rgba(4, 40, 30, 0.68);
  backdrop-filter: blur(14px);
}

.button-icon {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 23px;
}

.primary-action strong,
.secondary-action strong {
  display: block;
  margin-bottom: 3px;
  font-size: 17px;
}

.primary-action small,
.secondary-action small {
  display: block;
  color: currentColor;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.68;
}

.home-footer {
  position: absolute;
  right: max(44px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(44px, env(safe-area-inset-left));
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.text-button {
  padding: 0;
  color: var(--gold-soft);
  background: transparent;
  font-weight: 700;
}

.game-screen {
  position: relative;
  background:
    radial-gradient(ellipse at center, rgba(28, 142, 105, 0.44), transparent 55%),
    linear-gradient(180deg, #084735, #043126);
}

.game-screen::after {
  position: absolute;
  inset: 46px 0 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.022'%3E%3Cpath d='M0 40h80M40 0v80'/%3E%3Ccircle cx='40' cy='40' r='22'/%3E%3C/g%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  height: 46px;
  align-items: center;
  gap: 10px;
  padding:
    max(5px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    5px
    max(12px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(2, 29, 22, 0.78);
  backdrop-filter: blur(12px);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 18px;
  font-weight: 800;
}

.round-score {
  display: flex;
  height: 32px;
  align-items: baseline;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.round-score span {
  color: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.round-score strong {
  font-size: 15px;
}

.status-pill {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #e9f8f2;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill.your-turn {
  color: #ffe19a;
}

.top-actions {
  display: flex;
  gap: 6px;
}

.table {
  position: absolute;
  z-index: 1;
  inset: 46px 0 0;
}

.seat {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 112px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(1, 35, 26, 0.76);
  box-shadow: 0 8px 18px rgba(0, 21, 16, 0.24);
  backdrop-filter: blur(8px);
}

.seat-top {
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
}

.seat-left {
  top: 42%;
  left: 8px;
  transform: translateY(-50%);
}

.seat-right {
  top: 42%;
  right: 8px;
  transform: translateY(-50%);
}

.seat.active {
  border-color: rgba(245, 202, 94, 0.76);
  box-shadow: 0 0 0 2px rgba(245, 202, 94, 0.14);
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: linear-gradient(145deg, #388a70, #155843);
  font-size: 11px;
  font-weight: 900;
}

.avatar.has-image {
  border: 1px solid rgba(244, 206, 105, .7);
  background-position: center;
  background-size: cover;
}

.seat:nth-of-type(2) .avatar {
  background: linear-gradient(145deg, #477fca, #2f527e);
}

.seat:nth-of-type(3) .avatar {
  background: linear-gradient(145deg, #bf6e48, #763c25);
}

.you-avatar {
  background: linear-gradient(145deg, #e5b948, #9a6819);
}

.seat-copy {
  min-width: 0;
}

.seat-copy strong,
.seat-copy small {
  display: block;
}

.seat-copy strong {
  overflow: hidden;
  max-width: 86px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-copy small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 8px;
}

.seat-tiles {
  display: flex;
  margin-left: auto;
}

.seat-tiles i {
  display: block;
  width: 7px;
  height: 19px;
  margin-left: -3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  background: #0a4636;
}

.center-zone {
  position: absolute;
  top: 53px;
  right: 126px;
  bottom: clamp(152px, 38vh, 198px);
  left: 126px;
}

.table-info {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: 6px;
}

.indicator-box,
.okey-box {
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(3, 46, 35, 0.64);
}

.indicator-box > span,
.okey-box > span {
  color: rgba(255, 255, 255, 0.46);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.okey-box {
  display: grid;
  min-width: 63px;
  gap: 0;
}

.okey-box strong {
  color: var(--gold-soft);
  font-size: 12px;
}

.piles {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 7px;
}

.draw-pile,
.discard-pile {
  position: relative;
  display: grid;
  min-width: 58px;
  height: 71px;
  place-items: center;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  background: rgba(2, 39, 29, 0.74);
}

.draw-pile.enabled,
.discard-pile.enabled {
  border-color: rgba(244, 205, 105, 0.9);
  box-shadow: 0 0 0 3px rgba(244, 205, 105, 0.12);
  animation: pulse-pile 1.4s ease-in-out infinite;
}

@keyframes pulse-pile {
  50% {
    transform: translateY(-2px);
  }
}

.draw-pile strong {
  position: absolute;
  top: 2px;
  right: 4px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 9px;
  color: #17342d;
  background: var(--gold);
  font-size: 8px;
}

.draw-pile small,
.discard-pile small {
  align-self: end;
  color: rgba(255, 255, 255, 0.55);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.tile-back {
  display: grid;
  place-items: center;
  border: 2px solid #d8caa8;
  color: rgba(255, 255, 255, 0.85);
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, 0.08) 5px 7px),
    #0b664c;
  font-weight: 900;
}

.mini-back {
  width: 30px;
  height: 41px;
  border-radius: 6px;
  font-size: 9px;
}

.meld-board {
  position: absolute;
  top: 78px;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: auto;
  padding: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 15px;
  background: rgba(1, 46, 33, 0.3);
  scrollbar-width: none;
}

.meld-board::-webkit-scrollbar,
.player-rack::-webkit-scrollbar {
  display: none;
}

#emptyMeldText {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  text-align: center;
}

.meld-owner {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.meld-owner-label {
  width: 45px;
  flex: 0 0 auto;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.64);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.meld-list {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
  gap: 5px;
}

.meld {
  display: flex;
  gap: 1px;
  padding: 2px;
  border-radius: 6px;
  background: rgba(0, 24, 18, 0.34);
}

.rack-area {
  position: absolute;
  z-index: 5;
  right: max(8px, env(safe-area-inset-right));
  bottom: max(6px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left));
  height: clamp(142px, 36vh, 188px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(2, 43, 32, 0.94), rgba(1, 27, 21, 0.97));
  box-shadow: 0 -12px 35px rgba(0, 22, 16, 0.25);
}

.rack-toolbar {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.player-badge {
  display: flex;
  min-width: 92px;
  align-items: center;
  gap: 7px;
}

.player-badge strong,
.player-badge small {
  display: block;
}

.player-badge strong {
  font-size: 11px;
}

.player-badge small {
  color: rgba(255, 255, 255, 0.52);
  font-size: 8px;
}

.rack-actions {
  display: flex;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rack-actions::-webkit-scrollbar {
  display: none;
}

.tool-button {
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 9px;
  font-weight: 800;
}

.tool-button.accent {
  color: #17342d;
  border-color: rgba(245, 205, 103, 0.35);
  background: var(--gold);
}

.tool-button.danger {
  background: #b83f3a;
}

.tool-button.message {
  color: #d9ecff;
  background: #2c679c;
}

.rack-shell {
  height: calc(100% - 42px);
  overflow: hidden;
  padding: 7px 10px 9px;
}

.player-rack {
  display: grid;
  height: 100%;
  align-content: center;
  justify-content: center;
  grid-template-columns: repeat(15, minmax(26px, 1fr));
  grid-template-rows: repeat(2, minmax(42px, 1fr));
  gap: 3px 2px;
  padding: 3px;
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 18% 82%, rgba(255, 255, 255, 0.035)),
    #143b31;
  box-shadow: inset 0 3px 10px rgba(0, 19, 14, 0.42);
}
.rack-slot { position:relative; display:grid; min-width:0; min-height:0; place-items:center; border:1px solid rgba(255,255,255,.055); border-radius:6px; background:rgba(0,19,14,.18); }
.rack-slot .game-tile { width:100%; min-width:0; max-width:none; height:100%; max-height:none; touch-action:none; }
.rack-slot.drop-ready { background:rgba(244,206,105,.22); box-shadow:inset 0 0 0 2px rgba(244,206,105,.82); }
.game-tile.drag-source { opacity:.38; }
.tile-drag-ghost { position:fixed!important; z-index:500; pointer-events:none; transform:translate(-50%,-50%) scale(1.06); box-shadow:0 12px 24px rgba(0,18,13,.48)!important; }
#discardPile.drop-ready { border-color:#ffe08a; background:rgba(202,78,62,.82); box-shadow:0 0 0 4px rgba(255,224,138,.2); }

.game-tile {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 31px;
  max-width: 44px;
  height: 100%;
  max-height: 64px;
  place-items: center;
  align-self: center;
  overflow: hidden;
  border: 1px solid #c9bc9b;
  border-radius: 7px;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf5, #e8ddc5);
  box-shadow: 0 3px 5px rgba(0, 18, 13, 0.3);
  font-weight: 900;
  transition: transform 90ms ease, box-shadow 90ms ease;
}

button.game-tile {
  padding: 0;
}

.game-tile.selected {
  z-index: 3;
  border-color: #ffd15d;
  box-shadow: 0 0 0 3px rgba(255, 209, 93, 0.48), 0 7px 12px rgba(0, 18, 13, 0.4);
  transform: translateY(-7px);
}

.game-tile .tile-number {
  font-size: clamp(17px, 3.5vh, 25px);
  line-height: 1;
}

.game-tile .tile-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.game-tile.tile-red {
  color: var(--red);
}

.game-tile.tile-blue {
  color: var(--blue);
}

.game-tile.tile-yellow {
  color: var(--yellow);
}

.game-tile.tile-black {
  color: var(--black);
}

.game-tile.branded-okey {
  grid-template-rows: auto auto;
  align-content: center;
  gap: 3px;
  border: 2px solid currentColor;
  background: linear-gradient(145deg, #fffdf3, #f3dfaa);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65), 0 3px 7px rgba(0,18,13,.32);
}

.game-tile.branded-okey .tile-number {
  font-size: clamp(8px, 1.65vh, 12px);
  line-height: .9;
  letter-spacing: -.06em;
  white-space: nowrap;
}

.okey-color-label {
  padding: 2px 3px;
  border-radius: 4px;
  color: white;
  background: #17342d;
  font-size: clamp(5px, .8vh, 7px);
  line-height: 1;
  letter-spacing: .02em;
}

.game-tile.tile-red .okey-color-label { background:var(--red); }
.game-tile.tile-blue .okey-color-label { background:var(--blue); }
.game-tile.tile-black .okey-color-label { background:var(--black); }
.game-tile.tile-yellow .okey-color-label { color:#2b2415; background:var(--yellow); }

.game-tile.compact.branded-okey,
.game-tile.tiny.branded-okey,
.game-tile.micro.branded-okey { gap:1px; border-width:1px; }

.game-tile.compact.branded-okey .tile-number { font-size:7px; }
.game-tile.tiny.branded-okey .tile-number { font-size:6px; }
.game-tile.micro.branded-okey .tile-number { font-size:4px; }
.game-tile.compact.branded-okey .okey-color-label { padding:1px 2px; font-size:4px; }
.game-tile.tiny.branded-okey .okey-color-label,
.game-tile.micro.branded-okey .okey-color-label { padding:1px; font-size:3px; }

.game-tile.fake-joker .tile-number {
  font-size: clamp(13px, 2.5vh, 18px);
}

.game-tile.fake-joker::before {
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.45;
}

.game-tile.compact {
  width: 28px;
  min-width: 28px;
  height: 40px;
  border-radius: 5px;
}

.game-tile.compact .tile-number {
  font-size: 14px;
}

.game-tile.tiny {
  width: 23px;
  min-width: 23px;
  height: 32px;
  border-radius: 4px;
}

.game-tile.tiny .tile-number {
  font-size: 11px;
}

.game-tile.tiny .tile-dot {
  width: 3px;
  height: 3px;
}

.speech-layer {
  position: absolute;
  z-index: 9;
  inset: 0;
  pointer-events: none;
}

.speech-bubble {
  position: absolute;
  max-width: 145px;
  padding: 7px 10px;
  border-radius: 12px 12px 12px 3px;
  color: #17342d;
  background: #fff7df;
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 800;
  animation: bubble-in 180ms ease-out;
}

.speech-bubble.from-you {
  right: 15px;
  bottom: calc(clamp(142px, 36vh, 188px) + 8px);
  border-radius: 12px 12px 3px 12px;
  color: white;
  background: #2b6e9e;
}

.speech-bubble.from-top {
  top: 54px;
  left: 50%;
  transform: translateX(-50%);
}

.speech-bubble.from-left {
  top: 48%;
  left: 104px;
}

.speech-bubble.from-right {
  top: 48%;
  right: 104px;
  border-radius: 12px 12px 3px 12px;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 17, 13, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(92vw, 430px);
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 23px;
  background: linear-gradient(160deg, #0c513e, #052e24);
  box-shadow: 0 30px 70px rgba(0, 15, 11, 0.54);
}

.modal-card h2 {
  margin-bottom: 7px;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.modal-card > p:not(.eyebrow):not(.modal-note) {
  color: rgba(255, 255, 255, 0.67);
  font-size: 12px;
  line-height: 1.5;
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.radar {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid rgba(244, 205, 103, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(244, 205, 103, 0.28) 0 2px, transparent 3px),
    repeating-radial-gradient(circle, transparent 0 14px, rgba(244, 205, 103, 0.13) 15px 16px),
    conic-gradient(from 0deg, rgba(244, 205, 103, 0.5), transparent 25%, transparent);
  animation: radar-spin 2s linear infinite;
}

.radar span {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 50%;
  color: #17342d;
  background: var(--gold);
  font-size: 21px;
  font-weight: 900;
  animation: radar-counter 2s linear infinite;
}

@keyframes radar-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes radar-counter {
  to {
    transform: rotate(-360deg);
  }
}

.matchmaking-card {
  text-align: center;
}

.matchmaking-actions,
.live-log-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.home-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-log-card {
  width: min(620px, 94vw);
  text-align: left;
}

.live-log-output {
  height: min(250px, 42vh);
  margin: 8px 0;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(117, 208, 174, 0.2);
  border-radius: 10px;
  color: #b9f5de;
  background: #031b15;
  font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  user-select: text;
}

.search-seats {
  display: grid;
  margin: 16px 0;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.search-seats span {
  padding: 8px 4px;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 800;
}

.search-seats .found {
  color: #14372e;
  background: #75d0ae;
}

.search-seats .searching {
  background: rgba(255, 255, 255, 0.07);
}

.message-options {
  display: grid;
  margin: 10px 0;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.message-option {
  padding: 11px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 10px;
  font-weight: 800;
}

.modal-note {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 21, 16, 0.25);
  font-size: 9px;
  line-height: 1.5;
}

.rules-card ol {
  margin: 8px 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.77);
  font-size: 11px;
  line-height: 1.5;
}

.rules-card li + li {
  margin-top: 6px;
}

.modal-primary,
.modal-secondary {
  min-width: 105px;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 900;
}

.modal-primary {
  color: #18372e;
  background: var(--gold);
}

.modal-secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
}

.result-card {
  text-align: center;
}

.result-icon {
  margin-bottom: 5px;
  font-size: 42px;
}

.result-scores {
  display: grid;
  margin: 13px 0;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.result-score {
  padding: 8px 4px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.result-score strong,
.result-score small {
  display: block;
}

.result-score strong {
  margin-top: 3px;
  color: var(--gold-soft);
  font-size: 13px;
}

.result-score small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.57);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.toast {
  position: fixed;
  z-index: 150;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 2px);
  left: 50%;
  max-width: min(86vw, 520px);
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(2, 26, 20, 0.92);
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-height: 440px) {
  .top-bar {
    height: 42px;
  }

  .table {
    inset: 42px 0 0;
  }

  .center-zone {
    top: 47px;
    bottom: 150px;
  }

  .rack-area {
    height: 138px;
  }

  .rack-toolbar {
    height: 38px;
  }

  .rack-shell {
    height: calc(100% - 38px);
    padding-top: 4px;
    padding-bottom: 6px;
  }

  .game-tile {
    max-height: 50px;
  }

  .game-tile .tile-number {
    font-size: 18px;
  }

  .meld-board {
    top: 66px;
  }

  .draw-pile,
  .discard-pile {
    height: 61px;
  }

  .indicator-box,
  .okey-box {
    min-height: 42px;
  }
}

@media (max-width: 760px) {
  .home-screen {
    gap: 18px;
    padding: 22px 28px;
  }

  .brand-card {
    gap: 17px;
  }

  .brand-mark {
    width: 105px;
    border-width: 6px;
    border-radius: 20px;
  }

  .brand-card h1 {
    font-size: 36px;
  }

  .subtitle {
    font-size: 12px;
  }

  .primary-action,
  .secondary-action {
    min-height: 70px;
    padding: 11px 14px;
  }

  .button-icon {
    width: 40px;
    height: 40px;
  }

  .center-zone {
    right: 111px;
    left: 111px;
  }

  .seat {
    min-width: 101px;
  }

  .player-badge {
    min-width: 69px;
  }

  .tool-button {
    padding: 6px 8px;
    font-size: 8px;
  }
}

@media (orientation: portrait) {
  .home-screen {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .brand-card {
    justify-content: center;
  }

  .home-actions {
    width: min(100%, 520px);
    justify-self: center;
  }

  .home-footer {
    display: none;
  }

  .game-screen::before {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 40px;
    color: white;
    background: #063e30;
    content: "Daha rahat oynamak için telefonu yatay çevir.";
    font-size: 18px;
    font-weight: 800;
    text-align: center;
  }
}

/* v0.3.0: görünür taş geçmişi, Yancılar ve ücretsiz masa ikramları */
.rule-mode-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.rule-mode {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(2, 32, 24, 0.55);
  text-align: left;
}

.rule-mode.active {
  border-color: rgba(244, 206, 105, 0.82);
  color: #17342d;
  background: var(--gold);
}

.rule-mode strong {
  font-size: 10px;
}

.rule-mode small {
  font-size: 8px;
  opacity: 0.68;
}

.rack-score {
  display: grid;
  min-width: 88px;
  place-items: center;
  padding: 2px 8px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1;
}

.rack-score small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 6px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.rack-score strong {
  color: var(--gold-soft);
  font-size: 17px;
}

.rack-score span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 7px;
}

.rack-score.ready {
  border-radius: 8px;
  background: rgba(244, 206, 105, 0.15);
}

.rack-score.ready strong,
.rack-score.ready span {
  color: #ffe092;
}

.watch-action {
  min-height: 68px;
}

.seat.gift-target,
.wingman-button {
  cursor: pointer;
}

.seat.gift-target:active {
  border-color: var(--gold);
  filter: brightness(1.12);
}

.seat-bottom {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
}

.discard-trail {
  position: absolute;
  display: flex;
  max-width: 120px;
  gap: 2px;
  pointer-events: none;
}

.seat-top .discard-trail {
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
}

.seat-left .discard-trail {
  top: calc(100% + 4px);
  left: 0;
}

.seat-right .discard-trail {
  top: calc(100% + 4px);
  right: 0;
}

.seat-bottom .discard-trail {
  right: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(50%);
}

.game-tile.micro {
  width: 17px;
  min-width: 17px;
  height: 24px;
  border-radius: 3px;
}

.game-tile.micro .tile-number {
  font-size: 8px;
}

.game-tile.micro .tile-dot {
  width: 2px;
  height: 2px;
}

.center-zone {
  z-index: 3;
}

.meld-expand-button {
  position: absolute;
  z-index: 2;
  right: 7px;
  bottom: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(244, 217, 138, 0.38);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(2, 38, 29, 0.9);
  font-size: 8px;
  font-weight: 800;
}

.wingmen-panel {
  position: absolute;
  z-index: 8;
  top: 7px;
  right: 8px;
  width: 118px;
  max-height: 78px;
  overflow: hidden;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(1, 35, 26, 0.78);
}

.wingmen-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold-soft);
  font-size: 8px;
}

.wingmen-heading span {
  display: grid;
  min-width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 8px;
  color: #17342d;
  background: var(--gold);
}

.wingmen-list {
  display: flex;
  margin-top: 4px;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.wingmen-empty {
  color: rgba(255, 255, 255, 0.43);
  font-size: 7px;
}

.wingman-button {
  max-width: 92px;
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 7px;
  color: #e5f7f0;
  background: rgba(255, 255, 255, 0.08);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spectator-banner {
  position: absolute;
  z-index: 8;
  top: 7px;
  left: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(244, 217, 138, 0.27);
  border-radius: 9px;
  color: var(--gold-soft);
  background: rgba(1, 35, 26, 0.82);
  font-size: 7px;
  font-weight: 800;
}

.game-screen.spectator-mode .rack-area {
  display: none;
}

.game-screen.spectator-mode .center-zone {
  right: 130px;
  bottom: 70px;
  left: 130px;
}

.game-screen.spectator-mode .seat-left,
.game-screen.spectator-mode .seat-right {
  top: 50%;
}

.gift-options {
  display: grid;
  margin: 14px 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.gift-options button {
  display: grid;
  min-height: 95px;
  place-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.gift-options button:active {
  transform: scale(0.96);
}

.gift-options span {
  font-size: 34px;
}

.gift-options strong {
  color: var(--gold-soft);
  font-size: 11px;
}

.profile-discards {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(0, 24, 18, 0.24);
}

.profile-discards > strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 8px;
  text-transform: uppercase;
}

.profile-discard-list {
  display: flex;
  min-height: 25px;
  flex-wrap: wrap;
  gap: 3px;
}

.gift-layer {
  position: fixed;
  z-index: 150;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gift-pop {
  position: absolute;
  right: 16px;
  bottom: 22%;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 16px;
  background: rgba(3, 49, 37, 0.94);
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 800;
  animation: gift-float 3s ease forwards;
}

.gift-pop > span {
  font-size: 27px;
}

@keyframes gift-float {
  0% { opacity: 0; transform: translateY(20px) scale(0.85); }
  12%, 76% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-34px) scale(0.94); }
}

.watch-card {
  width: min(92vw, 560px);
}

.watch-room-list {
  display: grid;
  max-height: 54vh;
  margin: 12px 0;
  gap: 8px;
  overflow-y: auto;
}

.watch-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.watch-room strong,
.watch-room small {
  display: block;
}

.watch-room strong {
  overflow: hidden;
  max-width: 370px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-room small,
.watch-empty {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
}

.watch-room > span {
  min-width: max-content;
  padding: 5px 8px;
  border-radius: 8px;
  color: #17342d;
  background: var(--gold);
  font-size: 8px;
  font-weight: 900;
}

.meld-modal-card {
  width: min(94vw, 820px);
}

.expanded-meld-board {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  min-height: 180px;
  max-height: 58vh;
  margin-top: 10px;
}

.expanded-meld-board .game-tile.tiny {
  width: 31px;
  min-width: 31px;
  height: 43px;
}

.expanded-meld-board .game-tile.tiny .tile-number {
  font-size: 14px;
}

.empty-meld-text {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.34);
  font-size: 10px;
  text-align: center;
}

@media (max-height: 520px) and (orientation: landscape) {
  .home-actions {
    gap: 6px;
  }

  .nickname-field input {
    height: 34px;
  }

  .account-button { height:34px; }

  .rule-mode {
    padding: 6px 9px;
  }

  .primary-action,
  .secondary-action,
  .watch-action {
    min-height: 55px;
    padding: 7px 13px;
    border-radius: 15px;
  }

  .button-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 18px;
  }

  .primary-action strong,
  .secondary-action strong {
    font-size: 14px;
  }

  .primary-action small,
  .secondary-action small {
    font-size: 9px;
  }
}

/* v0.3.1: gerçek masa yönü ve tam atılan taş alanları */
.rack-area {
  right: max(104px, env(safe-area-inset-right));
  left: max(104px, env(safe-area-inset-left));
}

.discard-zone {
  position: absolute;
  z-index: 6;
  overflow: hidden;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(1, 34, 25, 0.73);
  box-shadow: 0 6px 15px rgba(0, 20, 14, 0.2);
}

.discard-zone-left,
.discard-zone-right {
  bottom: max(6px, env(safe-area-inset-bottom));
  width: 92px;
  height: clamp(142px, 36vh, 188px);
}

.discard-zone-left {
  left: max(6px, env(safe-area-inset-left));
}

.discard-zone-right {
  right: max(6px, env(safe-area-inset-right));
}

.discard-zone-top {
  top: 54px;
  left: 50%;
  width: min(300px, 36vw);
  min-height: 39px;
  max-height: 67px;
  transform: translateX(-50%);
}

.discard-zone-bottom {
  bottom: 7px;
  left: 50%;
  width: min(300px, 40vw);
  min-height: 39px;
  max-height: 67px;
  transform: translateX(-50%);
}

.discard-zone-label {
  display: block;
  margin-bottom: 3px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.5);
  font-size: 6px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.discard-zone-list {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 2px;
}

.discard-zone-empty {
  color: rgba(255, 255, 255, 0.3);
  font-size: 7px;
}

.discard-zone .game-tile.micro {
  width: 17px;
  min-width: 17px;
  height: 23px;
}

.discard-zone .latest-discard {
  z-index: 1;
  border-color: #ffe08a;
  box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.45);
}

.discard-zone.takeable-discard-zone {
  cursor: pointer;
  border-color: rgba(255, 224, 138, 0.88);
  box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.22), 0 6px 15px rgba(0, 20, 14, 0.2);
}

.discard-zone .takeable-discard {
  animation: takeable-tile-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes takeable-tile-pulse {
  from { transform: translateY(0); filter: brightness(1); }
  to { transform: translateY(-3px); filter: brightness(1.18); }
}

.game-screen.spectator-mode .rack-area {
  display: none;
}

@media (max-height: 440px) {
  .rack-area,
  .discard-zone-left,
  .discard-zone-right {
    height: 138px;
  }

  .discard-zone-top {
    top: 49px;
  }
}

@media (max-width: 700px) {
  .rack-area {
    right: 91px;
    left: 91px;
  }

  .discard-zone-left,
  .discard-zone-right {
    width: 82px;
  }

  .discard-zone .game-tile.micro {
    width: 15px;
    min-width: 15px;
    height: 21px;
  }
}

/* v0.4.0: çift açma, sıralama ve dar ekran düzeni */
.rank-score {
  display: flex;
  height: 32px;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(244, 217, 138, 0.2);
  border-radius: 10px;
  background: rgba(244, 206, 105, 0.1);
}

.rank-score span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 7px;
  font-weight: 800;
}

.rank-score strong {
  color: var(--gold-soft);
  font-size: 13px;
}

.rack-actions {
  justify-content: flex-start;
  overscroll-behavior-x: contain;
}

#sortRunButton {
  border-color: rgba(244, 206, 105, 0.55);
  color: #ffe29d;
  background: rgba(244, 206, 105, 0.13);
}

#discardButton {
  display: none;
}

.rack-score {
  grid-template-columns: auto auto;
  min-width: 82px;
  column-gap: 4px;
}

.rack-score small,
.rack-score span {
  grid-column: 1 / -1;
}

.rack-score strong {
  justify-self: end;
}

.rack-score b {
  color: #c7eee0;
  font-size: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.standings-title {
  margin: 9px 0 5px;
  color: var(--gold-soft);
  font-size: 10px;
  text-transform: uppercase;
}

.standings-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.standing-row {
  display: grid;
  align-items: center;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
}

.standing-row.you {
  border-color: rgba(244, 206, 105, 0.45);
  background: rgba(244, 206, 105, 0.11);
}

.standing-position {
  color: var(--gold-soft);
  font-size: 14px;
  font-weight: 900;
}

.standing-name {
  overflow: hidden;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.standing-wins {
  color: rgba(255, 255, 255, 0.5);
  font-size: 8px;
}

.standing-total {
  min-width: 38px;
  color: #ffe19a;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.compact-standings {
  margin: 0 0 12px;
}

.compact-standings .standing-row {
  padding: 6px 8px;
}

@media (max-width: 760px) {
  .top-bar {
    gap: 5px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .round-score,
  .rank-score {
    padding-right: 7px;
    padding-left: 7px;
  }

  .player-badge {
    min-width: 60px;
    max-width: 68px;
  }

  .player-badge > div {
    min-width: 0;
  }

  .player-badge strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .rack-score {
    min-width: 72px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .rack-toolbar {
    gap: 5px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .tool-button {
    padding: 6px 8px;
    font-size: 8px;
  }
}

@media (max-width: 620px) {
  .connection-badge {
    display: none;
  }

  .rack-area {
    right: 86px;
    left: 86px;
  }

  .discard-zone-left,
  .discard-zone-right {
    width: 78px;
  }
}

/* v0.5.0 · 73 Okey 101 adil lig ve görünüm sistemi */
.brand-mark {
  grid-template-rows: 1fr auto;
  padding: 17px 7px 13px;
}

.brand-mark span {
  align-self: end;
  font-size: clamp(52px, 8.2vw, 94px);
}

.brand-mark strong {
  z-index: 1;
  align-self: start;
  color: #8a4d12;
  font-size: clamp(11px, 1.7vw, 18px);
  letter-spacing: .08em;
  white-space: nowrap;
}

.home-actions {
  gap: 8px;
}

.lobby-economy {
  display: grid;
  min-width: 0;
  align-items: center;
  grid-template-columns: 48px 82px 92px minmax(0, 1fr);
  gap: 7px;
  padding: 7px;
  border: 1px solid rgba(244, 206, 105, .2);
  border-radius: 16px;
  background: rgba(1, 32, 24, .75);
  box-shadow: var(--shadow);
}

.lobby-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #17342d;
  background: linear-gradient(145deg, #ffe194, #d89c2d);
  font-size: 14px;
  font-weight: 1000;
}

.lobby-avatar.frame-silver { box-shadow: 0 0 0 3px #b8d8dd; }
.lobby-avatar.frame-gold { box-shadow: 0 0 0 3px #ffd667, 0 0 15px rgba(255, 214, 103, .5); }

.lobby-balance {
  display: grid;
  min-width: 0;
  gap: 1px;
  padding: 5px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.lobby-balance small {
  overflow: hidden;
  color: rgba(255, 255, 255, .48);
  font-size: 6px;
  font-weight: 900;
  letter-spacing: .05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-balance strong {
  color: var(--gold-soft);
  font-size: 14px;
}

.lobby-balance strong b { font:inherit; }

.chip-balance strong { color: #a9ead5; }

.lobby-shortcuts {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.lobby-shortcuts button {
  display: grid;
  min-width: 0;
  gap: 1px;
  place-items: center;
  padding: 6px 3px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  font-size: 13px;
}

.lobby-shortcuts span {
  overflow: hidden;
  width: 100%;
  color: rgba(255, 255, 255, .72);
  font-size: 6px;
  font-weight: 800;
  text-overflow: ellipsis;
}

.fair-mini-wallet {
  display: flex;
  height: 32px;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(244, 206, 105, .2);
  border-radius: 10px;
  background: rgba(244, 206, 105, .08);
  font-size: 8px;
}

.fair-mini-wallet b { color: var(--gold-soft); }
.fair-mini-wallet .mini-chip b { color: #a9ead5; }

.account-card { width:min(94vw, 520px); max-height:92dvh; overflow-y:auto; }
.account-card .modal-heading { position:sticky; top:-20px; z-index:8; margin:-20px -20px 0; padding:20px 20px 9px; background:linear-gradient(160deg, #0c513e, #0a4938); }
.account-heading-actions { display:flex; align-items:center; gap:7px; }
.account-quick-save { min-height:34px; padding:7px 12px; border:1px solid rgba(255,225,155,.68); border-radius:10px; color:#17342d; background:var(--gold); font-size:9px; font-weight:950; }
.account-fields { display:grid; margin:10px 0; grid-template-columns:1fr 1fr; gap:8px; }
.account-fields label { display:grid; gap:4px; color:rgba(255,255,255,.62); font-size:8px; font-weight:800; }
.account-fields input { width:100%; height:38px; padding:0 11px; border:1px solid rgba(255,255,255,.14); border-radius:10px; outline:0; color:white; background:rgba(1,31,23,.72); font:inherit; user-select:text; }
.account-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.account-actions button { min-width:0; padding:9px 5px; }
.account-profile-section { display:grid; gap:8px; margin-top:10px; }
.account-section-heading { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding-top:8px; border-top:1px solid rgba(255,255,255,.09); }
.account-section-heading strong { color:#ffe19b; font-size:10px; }
.account-section-heading small { color:rgba(255,255,255,.45); font-size:7px; }
.password-heading { margin-top:4px; }
.account-avatar-editor { display:flex; align-items:center; gap:10px; }
.account-avatar-editor > div { display:flex; flex-wrap:wrap; gap:6px; }
.account-avatar-preview { display:grid; width:54px; height:54px; place-items:center; flex:0 0 auto; overflow:hidden; border:2px solid var(--gold); border-radius:50%; background:#174f40 center/cover no-repeat; color:#fff3c2; font-size:13px; font-weight:900; }
.account-file-button, .account-avatar-editor button { display:grid; min-height:32px; place-items:center; padding:7px 10px; border-radius:9px; background:rgba(255,255,255,.08); color:white; font-size:8px; font-weight:900; cursor:pointer; }
.account-file-button input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.profile-fields { margin:0; }
.account-wide-field { grid-column:1 / -1; }
.account-wide-button { width:100%; }
.account-member-actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.account-member-actions button { padding:9px; }

.fair-card { width: min(94vw, 520px); }

.fair-tabs {
  display: grid;
  margin: 12px 0 8px;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.fair-tabs button {
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  font-size: 9px;
  font-weight: 900;
}

.fair-tabs button.active {
  color: #17342d;
  background: var(--gold);
}

.fair-region-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.fair-region-row label {
  display: grid;
  gap: 3px;
  color: rgba(255, 255, 255, .55);
  font-size: 7px;
  font-weight: 800;
}

.fair-region-row select {
  height: 31px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: white;
  background: #07382b;
  font: inherit;
  font-size: 9px;
}

.fair-ranking-list {
  display: grid;
  max-height: 255px;
  gap: 5px;
  overflow-y: auto;
  margin-top: 9px;
}

.fair-rank-row {
  display: grid;
  align-items: center;
  grid-template-columns: 26px 34px minmax(0, 1fr) auto;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .055);
}

.fair-rank-row.you {
  outline: 1px solid rgba(244, 206, 105, .65);
  background: rgba(244, 206, 105, .12);
}

.fair-rank-position { color: var(--gold-soft); font-size: 12px; font-weight: 900; }
.fair-rank-avatar { display:grid; width:30px; height:30px; place-items:center; border:1px solid var(--gold); border-radius:50%; background:#174f40 center/cover no-repeat; font-size:10px; font-weight:900; }
.fair-rank-row.system .fair-rank-copy small::after { content:" · Sistem rakibi"; color:#9fd6c0; }
.fair-rank-copy { min-width: 0; text-align: left; }
.fair-rank-copy strong, .fair-rank-copy small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fair-rank-copy strong { font-size:10px; }
.fair-rank-copy small { margin-top:2px; color:rgba(255,255,255,.43); font-size:7px; }
.fair-rank-points { color:#ffe09a; font-size:11px; font-weight:900; }

.reward-grid {
  display: grid;
  margin-top: 12px;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.reward-card {
  display: grid;
  gap: 5px;
  place-items: center;
  padding: 13px 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 13px;
  background: rgba(255, 255, 255, .055);
  text-align: center;
}

.reward-card > span { font-size: 23px; }
.reward-card strong { font-size: 11px; }
.reward-card small { min-height: 24px; color:rgba(255,255,255,.5); font-size:8px; line-height:1.4; }
.reward-card button, .cosmetic-action {
  padding: 8px 10px;
  border-radius: 9px;
  color: #17342d;
  background: var(--gold);
  font-size: 8px;
  font-weight: 900;
}
.reward-card button:disabled { color:white; background:rgba(255,255,255,.08); }

.fair-status {
  margin-top: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #c8f0df;
  background: rgba(53, 155, 116, .14);
  font-size: 8px;
  text-align: center;
}

.cosmetic-list {
  display: grid;
  max-height: 285px;
  gap: 7px;
  overflow-y: auto;
  margin-top: 12px;
}

.cosmetic-row {
  display: grid;
  align-items: center;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .055);
}
.cosmetic-preview { display:grid; width:38px; height:38px; place-items:center; border:1px solid rgba(244,206,105,.42); border-radius:50%; background:#164e3f; font-size:16px; font-weight:900; }
.cosmetic-copy strong, .cosmetic-copy small { display:block; }
.cosmetic-copy strong { font-size:10px; }
.cosmetic-copy small { margin-top:2px; color:rgba(255,255,255,.46); font-size:7px; }
.cosmetic-action.selected { color:#bcebd9; background:rgba(54,151,115,.2); }

.league-reward-notice {
  min-height: 26px;
  margin: 7px 0 10px;
  padding: 7px 9px;
  border-radius: 9px;
  color: #c8f0df;
  background: rgba(53, 155, 116, .13);
  font-size: 8px;
  font-weight: 800;
}

body[data-table-theme="midnight"] .game-screen {
  background: radial-gradient(ellipse at center, rgba(28, 102, 142, .44), transparent 55%), linear-gradient(180deg, #123952, #061e2c);
}
body[data-table-theme="burgundy"] .game-screen {
  background: radial-gradient(ellipse at center, rgba(145, 72, 79, .4), transparent 55%), linear-gradient(180deg, #54252e, #241116);
}

@media (max-height: 520px) and (orientation: landscape) {
  .lobby-economy { padding: 4px 6px; }
  .lobby-avatar { width: 38px; height: 38px; }
  .lobby-economy { grid-template-columns: 42px 76px 86px minmax(0,1fr); }
  .home-actions { gap: 5px; }
  .fair-ranking-list { max-height: 190px; }
  .cosmetic-list { max-height: 205px; }
}

@media (max-width: 760px) {
  .lobby-economy { grid-template-columns: 40px 67px 75px minmax(0,1fr); gap:4px; }
  .lobby-avatar { width:36px; height:36px; }
  .lobby-shortcuts button { padding:5px 2px; }
  .fair-mini-wallet { padding:5px 6px; }
}

@media (max-width: 650px) {
  .fair-mini-wallet .mini-chip { display:none; }
}
