:root {
    --bg: #0b0f17;
    --card: rgba(18, 26, 42, 0.9);
    --text: #e9eefc;
    --muted: #9fb0d0;
    --accent: #5aa7ff;
    --danger: #ff6b6b;
    --ok: #56d364;
    --border: #223150;
  }
  
  html, body {
    height: 100%;
    margin: 0;
  }
  
  * { box-sizing: border-box; }
  
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: transparent;
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial;
  }
  
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
      radial-gradient(1400px 900px at 15% 0%, #152a52 0%, rgba(11, 15, 23, 0.98) 55%, #0b0f17 100%),
      radial-gradient(900px 700px at 85% 15%, rgba(90, 167, 255, 0.18) 0%, rgba(0, 0, 0, 0) 60%),
      linear-gradient(#0b0f17, #0b0f17);
    background-repeat: no-repeat;
    background-attachment: fixed;
  }
  
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    background: rgba(11, 15, 23, 0.75);
  }
  
  .brand .title {
    font-weight: 700;
    letter-spacing: 0.2px;
  }
  .brand .subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
  }
  
  .container {
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 18px auto 48px;
    padding: 0 16px;
  }
  
  .card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 14px;
  }
  
  h2 { margin: 0 0 12px; font-size: 18px; }
  
  .centerWrap {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
  }
  
  .loginCard { max-width: 520px; width: 100%; text-align: center; }
  .loginTitle { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
  .loginSub { color: var(--muted); margin: 0 0 14px; line-height: 1.35; }
  .loginCard h1, .loginCard p { margin-top: 0; }
  
  .grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  @media (max-width: 860px) { .grid { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 520px) { .grid { grid-template-columns: 1fr; } }
  
  .label { color: var(--muted); font-size: 12px; }
  .value { font-size: 16px; margin-top: 4px; }
  
  .row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
  }
  
  .input {
    width: 140px;
    padding: 10px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #0e1422;
    color: var(--text);
  }
  
  .btn {
    border: 1px solid transparent;
    background: var(--accent);
    color: #07101f;
    font-weight: 700;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
  }
  .btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .btn-secondary { background: transparent; border-color: var(--border); color: var(--text); }
  
  .msg { margin-top: 10px; min-height: 20px; color: var(--muted); }
  .msg.ok { color: var(--ok); }
  .msg.err { color: var(--danger); }
  .msg.pending { color: var(--muted); }
  
  .hidden { display: none !important; }
  .muted { color: var(--muted); }
  
  .table { margin-top: 14px; display: grid; gap: 12px; }
  .hand-title { font-weight: 700; margin-bottom: 8px; }
  
  .cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    min-height: 104px;
    align-items: flex-start;
  }
  
  .playing-card {
    width: 72px;
    height: 104px;
    perspective: 900px;
    position: relative;
  }
  
  .playing-card .inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 520ms cubic-bezier(.2,.8,.2,1);
  }
  
  .playing-card.face-down .inner {
    transform: rotateY(180deg);
  }
  
  .playing-card .face {
    position: absolute;
    inset: 0;
    border-radius: 0;
    border: 1px solid rgba(255,255,255,0.12);
    backface-visibility: hidden;
    background: rgba(10,15,25,0.55);
    overflow: hidden;
  }
  
  .playing-card .front { }
  
  .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
  }
  
  .playing-card .back {
    transform: rotateY(180deg);
    border-radius: 0;
    background:
      radial-gradient(circle at 30% 20%, rgba(90,167,255,0.45), rgba(90,167,255,0.05)),
      linear-gradient(180deg, rgba(18,26,42,0.95), rgba(10,15,25,0.95));
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .card-back-text {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 6px 18px rgba(0,0,0,0.55);
    user-select: none;
  }
  
  @keyframes dealIn {
    from { transform: translateX(16px) translateY(-8px) scale(0.98); opacity: 0; }
    to   { transform: translateX(0) translateY(0) scale(1); opacity: 1; }
  }
  .playing-card.deal { animation: dealIn 240ms ease-out; }
  
  .total { margin-top: 8px; }
  
  .footer {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.4;
  }

  .footer-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
  }

  .footer-link:hover {
    text-decoration: underline;
  }

  .footer-sep {
    display: inline-block;
    margin: 0 10px; /* spacing around the | */
    color: rgba(255, 255, 255, 0.35);
  }

  .footer-disclaimer {
    color: rgba(255, 255, 255, 0.55); /* slightly dimmer than link */
  }