.tile.group-start {
  margin-left: 10px;
}

.tile.dragging {
  opacity: .35;
  transform: scale(.92);
}

.rack .tile[draggable="true"] {
  cursor: grab;
}

.rack .tile[draggable="true"]:active {
  cursor: grabbing;
}

.rack-slot {
  display: block;
  min-width: 0;
  height: 76px;
  border-radius: 7px;
  background: #1b0e0828;
  box-shadow: inset 0 0 0 1px #ffffff08;
}

.rack-slot .tile {
  width: 100%;
}

.tile.real-okey {
  box-shadow: 0 0 0 3px #f0bd57, 0 0 18px #f0bd5790, 0 5px 6px #0005;
}

.tile.real-okey::after {
  content: "OKEY";
  position: absolute;
  top: 3px;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .6px;
  color: #8a5a00;
}

#okeyInfo {
  display: block;
  width: 86px;
  margin: 5px 0 0 -18px;
  color: #f7d78d;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.toolbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.legal-footer { display:flex; align-items:center; justify-content:center; gap:10px; padding:14px; color:#80998d; font-size:10px; }
.legal-footer button { border:0; background:none; color:#d1aa5b; padding:3px; font-size:10px; text-decoration:underline; }
.legal-dialog { width:min(680px,calc(100% - 24px)); max-width:680px; padding:24px; text-align:left; }
.legal-dialog h2 { margin:0 34px 14px 0; font-size:20px; }
.legal-dialog h3 { margin:18px 0 5px; color:#f0bd57; font-size:13px; }
.legal-dialog p { margin:0; color:#c6d3cc; font-size:12px; line-height:1.65; }
.legal-scroll { max-height:70vh; overflow:auto; padding-right:8px; }
.dialog-close { position:absolute; right:15px; top:12px; border:0; background:none; color:#fff; font-size:26px; }
.legal-warning { padding:10px; border:1px solid #c78937; border-radius:8px; background:#6f451f55; color:#f8deb1; font-size:11px; line-height:1.5; }
.legal-note { margin-top:20px!important; padding-top:12px; border-top:1px solid #ffffff18; }
.orientation-hint { display:none; }

.discard-pile.drop-ready {
  border: 3px solid #f0bd57;
  background: #f0bd5740;
  box-shadow: 0 0 24px #f0bd57;
  transform: scale(1.1);
}

@media (max-width: 720px) and (orientation: portrait) {
  .orientation-hint {
    position:fixed; inset:0; z-index:100;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:10px; padding:28px; text-align:center;
    background:radial-gradient(circle at center,#1a583d,#07130f 70%);
  }
  .orientation-hint .phone-icon {
    display:grid; place-items:center; width:70px; height:110px;
    border:4px solid #f0bd57; border-radius:14px;
    color:#f0bd57; font-size:36px; animation:turn-phone 1.8s ease-in-out infinite;
  }
  .orientation-hint strong { margin-top:12px; color:#f0bd57; font-size:20px; }
  .orientation-hint span { color:#b9ccc2; font-size:12px; }
}

@keyframes turn-phone {
  0%,30% { transform:rotate(0deg); }
  70%,100% { transform:rotate(90deg); }
}

@media (max-height: 500px) and (orientation: landscape) {
  .topbar { height:32px; }
  .status-row { height:36px; padding:3px 10px; }
  .status-row h1 { margin:1px 0; font-size:12px; }
  .table { height:158px; }
  .player-top { top:2px; }
  .player-left,.player-right { top:42%; }
  .center-stack { top:44%; transform:translate(-50%,-50%) scale(.62); }
  .turn-banner { bottom:39px; padding:3px 9px; }
  .me { bottom:3px; transform:translateX(-50%) scale(.82); }
  .rack-panel { padding:3px 4px 5px; }
  .rack-toolbar { margin-bottom:3px; }
  .rack-toolbar button { padding:4px 2px; }
  .rack-panel .rack { min-height:94px; grid-template-rows:repeat(2,42px); padding:3px; }
  .rack-slot { height:41px; }
  .rack-slot .tile { height:40px; }
  .tile .number { font-size:16px; line-height:15px; }
  .game-actions { margin-top:4px; }
  .game-actions button { padding:6px 3px; }
  .legal-footer { display:none; }
}

@media (max-width: 720px) {
  body { min-width: 0; overflow-x: hidden; }
  .app-shell { width: 100%; padding: 0; }
  .topbar { height: 46px; padding: 0 9px; gap: 8px; }
  .brand { font-size: 11px; letter-spacing: 1px; }
  .wallet { padding: 6px 9px; font-size: 10px; }
  .icon-button { padding: 6px 9px; }
  .game-card { border: 0; border-radius: 0; }
  .status-row { height: 50px; padding: 6px 10px; }
  .status-row h1 { font-size: 14px; }
  .eyebrow { font-size: 8px; }
  .new-game { padding: 6px 9px; font-size: 10px; }
  .table { height: 270px; }
  .table::after { inset: 8px; border-radius: 90px; }
  .player { padding: 3px 5px; border-radius: 10px; }
  .player .avatar { width: 26px; height: 26px; font-size: 10px; }
  .player-top { top: 6px; }
  .player-left { left: 4px; top: 43%; }
  .player-right { right: 4px; top: 43%; }
  .tile-count { padding: 2px 4px; font-size: 8px; }
  .center-stack { top: 45%; gap: 7px; transform: translate(-50%,-50%) scale(.76); }
  .turn-banner { bottom: 55px; padding: 5px 11px; font-size: 9px; }
  .me { bottom: 8px; padding: 4px 9px; }
  .me .avatar { width: 27px; height: 27px; font-size: 10px; }
  .rack-panel { padding: 6px 4px 8px; }
  .rack-toolbar { display: block; margin: 0 0 5px; min-height: 0; }
  #hintText { display: none; }
  .toolbar-actions { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; width: 100%; }
  .rack-toolbar button { padding: 6px 2px; font-size: 8px; white-space: nowrap; }
  .rack-panel .rack {
    width: 100%; min-height: 116px; padding: 4px; border-width: 4px;
    grid-template-columns: repeat(15,minmax(0,1fr));
    grid-template-rows: repeat(2,52px);
    gap: 2px 1px; overflow: visible;
  }
  .rack-slot { width: 100%; min-width: 0; height: 51px; }
  .rack-slot .tile { width: 100%; min-width: 0; height: 50px; padding: 0; border-radius: 3px; }
  .tile .number { font-size: clamp(13px,4.3vw,18px); line-height: 18px; }
  .tile .dot { font-size: 8px; line-height: 7px; }
  .tile.real-okey::after { content: "★"; top: 0; font-size: 7px; }
  .tile.group-start { margin-left: 0; box-shadow: -2px 0 0 #7d5030,0 3px 0 #b7aa8d; }
  .game-actions { gap: 4px; margin-top: 7px; }
  .game-actions button { flex: 1; padding: 9px 3px; font-size: 10px; }
  #okeyInfo { width: 80px; font-size: 7px; }
  .legal-footer { flex-wrap:wrap; padding:8px; gap:4px 9px; }
  .legal-footer span { width:100%; text-align:center; }
  .legal-dialog { padding:18px 14px; }
  .legal-dialog h2 { font-size:16px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .topbar { height:32px; }
  .status-row { height:36px; padding:3px 10px; }
  .status-row h1 { margin:1px 0; font-size:12px; }
  .table { height:158px; }
  .player-top { top:2px; }
  .player-left,.player-right { top:42%; }
  .center-stack { top:44%; transform:translate(-50%,-50%) scale(.62); }
  .turn-banner { bottom:39px; padding:3px 9px; }
  .me { bottom:3px; transform:translateX(-50%) scale(.82); }
  .rack-panel { padding:3px 4px 5px; }
  .rack-toolbar { margin-bottom:3px; }
  .rack-toolbar button { padding:4px 2px; }
  .rack-panel .rack { min-height:94px; grid-template-rows:repeat(2,42px); padding:3px; }
  .rack-slot { height:41px; }
  .rack-slot .tile { height:40px; }
  .tile .number { font-size:16px; line-height:15px; }
  .game-actions { margin-top:4px; }
  .game-actions button { padding:6px 3px; }
  .legal-footer { display:none; }
}
