:root {
    --bg: #050816;
    --bg-soft: #0b1020;
    --bg-card: #11172b;
    --bg-card-soft: #171f35;
    --accent: #ff4f6a;
    --accent-soft: rgba(255, 79, 106, 0.15);
    --accent-strong: #ffb347;
    --text: #f5f7ff;
    --text-soft: #aab3d8;
    --border-subtle: rgba(255, 255, 255, 0.06);
    --radius-lg: 18px;
    --radius-xl: 24px;
    --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.15s ease-out;
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }
  
  /* RESET */
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html, body {
    height: 100%;
  }
  
  body {
    font-family: var(--font);
    background: radial-gradient(circle at top left, #1b1f3b 0, #050816 45%, #000 100%);
    color: var(--text);
  }
  
  /* APP */
  
  .app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  /* HEADER */
  
  .app-header {
    text-align: center;
    padding: 12px 0 8px;
  }
  
  .app-title {
    font-size: 2.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #fff, var(--accent-strong));
    -webkit-background-clip: text;
    color: transparent;
  }
  
  .app-subtitle {
    margin-top: 4px;
    font-size: 0.95rem;
    color: var(--text-soft);
  }
  
  /* CARD */
  
  .card {
    background: radial-gradient(circle at top, #202744 0, #11172b 65%);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-subtle);
  }
  
  .card-centered {
    max-width: 420px;
    margin: 0 auto;
  }
  
  .card h2 {
    font-size: 1.4rem;
    margin-bottom: 10px;
  }
  
  .card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  
  /* FORM */
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }
  
  label {
    font-size: 0.85rem;
    color: var(--text-soft);
  }
  
  input[type="text"],
  select {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    background: rgba(6, 9, 21, 0.9);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  }
  
  input[type="text"]::placeholder {
    color: #5f6792;
  }
  
  input[type="text"]:focus,
  select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(255, 79, 106, 0.6);
    background: #070b1a;
  }
  
  /* BUTTONS */
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    gap: 6px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
  }
  
  .btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff7f55);
    color: #fff;
    box-shadow: 0 10px 20px rgba(255, 79, 106, 0.3);
  }
  
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(255, 79, 106, 0.45);
  }
  
  .btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-soft);
    border: 1px solid var(--border-subtle);
  }
  
  .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
  }
  
  .btn:active {
    transform: translateY(0);
    box-shadow: none;
  }
  
  /* LOBBY */
  
  .lobby-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
    align-items: center;
  }
  
  .lobby-actions h3 {
    margin-bottom: 4px;
  }
  
  .lobby-actions p {
    font-size: 0.9rem;
    color: var(--text-soft);
    margin-bottom: 8px;
  }
  
  .divider {
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
  }
  
  /* ROOM LAYOUT */
  
  .room-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }
  
  .room-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  
  /* ROOM HEADER + BADGES */
  
  .room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  
  .room-header h2 {
    font-size: 1.2rem;
  }
  
  .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  
  .badge-host {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }
  
  /* PLAYERS LIST */
  
  .players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 10px;
  }
  
  .player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(4, 7, 18, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
  }
  
  .player-main {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .player-avatar {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.07);
  }
  
  .player-pseudo {
    font-weight: 500;
  }
  
  /* ROOM CONTROLS */
  
  .room-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
  }
  
  /* BOARD */
  
  .board {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
  }
  
  .board-player {
    flex: 1 1 180px;
    min-width: 0;
    background: rgba(4, 7, 18, 0.95);
    border-radius: 12px;
    padding: 8px 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  }
  
  .board-player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }
  
  .board-player-header .player-pseudo {
    font-size: 0.9rem;
  }
  
  /* Joueur actif mis en avant */
  .board-player-active {
    border-color: var(--accent);
    box-shadow: 0 0 18px rgba(255, 79, 106, 0.4);
    transform: translateY(-2px);
  }
  
  .card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  
  /* CARD TILES */
  
  .card-tile {
    width: 40px;
    height: 56px;
    border-radius: 8px;
    background: radial-gradient(circle at top, #313b63 0, #12182b 70%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
    box-shadow: 0 10px 14px rgba(0, 0, 0, 0.35);
    transform-origin: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
  }
  
  .card-tile.card-hidden {
    background: radial-gradient(circle at top, #262b49 0, #090d1b 70%);
  }
  
  .card-tile.card-own {
    border-color: rgba(255, 255, 255, 0.4);
  }
  
  .card-tile.card-safe {
    background: radial-gradient(circle at top, #305e3a 0, #0b2310 70%);
  }
  
  .card-tile.card-defuse {
    background: radial-gradient(circle at top, #2d7f98 0, #071d25 70%);
  }
  
  .card-tile.card-bomb {
    background: radial-gradient(circle at top, #962c2c 0, #200707 70%);
  }
  
  .card-tile.card-revealed {
    border-color: rgba(255, 255, 255, 0.6);
  }
  
  .card-tile.card-clickable:hover {
    cursor: pointer;
    transform: translateY(-3px) rotate(-2deg);
    box-shadow: 0 16px 26px rgba(0, 0, 0, 0.55);
  }
  
  .card-symbol {
    pointer-events: none;
  }
  
  /* HINT */
  
  .hint {
    font-size: 0.8rem;
    color: var(--text-soft);
    margin-bottom: 6px;
  }

  /* ROLE BANNER */

.role-banner {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  }
  
  .role-banner-sherlock {
    background: linear-gradient(90deg, #1b4b8f, #2d8dff);
    color: #e6f2ff;
    box-shadow: 0 0 18px rgba(45, 141, 255, 0.4);
  }
  
  .role-banner-moriarty {
    background: linear-gradient(90deg, #8f1b3a, #ff4f6a);
    color: #ffe6ec;
    box-shadow: 0 0 18px rgba(255, 79, 106, 0.45);
  }

  /* ROLE BANNER */

.role-banner {
    margin-bottom: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  }
  
  .role-banner-sherlock {
    background: linear-gradient(90deg, #1b4b8f, #2d8dff);
    color: #e6f2ff;
    box-shadow: 0 0 18px rgba(45, 141, 255, 0.4);
  }
  
  .role-banner-moriarty {
    background: linear-gradient(90deg, #8f1b3a, #ff4f6a);
    color: #ffe6ec;
    box-shadow: 0 0 18px rgba(255, 79, 106, 0.45);
  }
  
  /* GAME INFO PANEL */
  
  .game-info {
    margin-top: 4px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
  }
  
  .game-info-line {
    color: var(--text-soft);
  }
  
  .game-info-main {
    margin-top: 4px;
    font-weight: 500;
    color: var(--text);
  }
  

  
  /* RESPONSIVE */
  
  @media (max-width: 540px) {
    .app {
      padding-inline: 10px;
    }
  
    .card {
      padding-inline: 14px;
    }
  
    .room-controls {
      flex-direction: column;
    }
  }
  