:root {
    --green: #1a4a2e;
    --green-light: #2d6e45;
    --green-dark: #0e2d1b;
    --felt: #1e5c38;
    --gold: #f0c040;
    --gold-dark: #c49a20;
    --red: #c0392b;
    --red-bright: #e74c3c;
    --cream: #f5e6c8;
    --cream-dark: #ddd0a8;
    --brown: #6b4c2a;
    --shadow: #0a1f11;
    --pixel-border: 3px solid #000;
    --pixel-shadow: 4px 4px 0px #000;
    --card-width: 72px;
    --card-height: 100px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

.logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    text-shadow: 3px 3px 0 #000;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 12px;
}

.game-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 22px;
    color: black;
    text-align: center;
    margin-bottom: 6px;
    text-shadow: 4px 4px 0 #000;
    animation: pixelFloat 3s ease-in-out infinite;
    line-height: 1.4;
}

.game-subtitle {
    font-family: 'Special Elite', 'Courier New', monospace;
    font-size: 20px;
    color: black;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 3px;
}

.card-deco {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.deco-card {
    width: 48px;
    height: 68px;
    background: var(--cream);
    border: 3px solid #000;
    border-radius: 4px;
    box-shadow: 3px 3px 0 #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}
.deco-card:nth-child(1) { transform: rotate(-12deg); color: var(--red); }
.deco-card:nth-child(2) { transform: rotate(-4deg) translateY(-6px); color: #1a1a2e; }
.deco-card:nth-child(3) { transform: rotate(4deg); color: var(--red); }
.deco-card:nth-child(4) { transform: rotate(12deg) translateY(-4px); color: #1a1a2e; }

.btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    padding: 12px 20px;
    border: 3px solid #000;
    cursor: pointer;
    position: relative;
    transition: transform 0.07s, box-shadow 0.07s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    text-decoration: none;
    user-select: none;
    image-rendering: pixelated;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: -1;
    border: 3px solid #000;
}

.btn:active {
    transform: translate(3px, 3px);
    box-shadow: none;
}
.btn:active::after {
    bottom: -3px;
    right: -3px;
}

.btn-gold {
    background: var(--gold);
    color: #000;
}

.btn-white {
    background: white;
    color: black;
}
.btn-green:hover { background: #3a8a55; }

.btn-gray {
    background: #555;
    color: #aaa;
    cursor: not-allowed;
}

.panel {
  border: 3px solid #000;
  box-shadow: var(--pixel-shadow);
  padding: 24px;
  position: relative;
}

.form-group { margin-bottom: 20px; }

.input-field {
  font-size: 14px;
  padding: 10px 14px;
  border: 3px solid #000;
  outline: none;
  letter-spacing: 1px;
  width: 100%;
}

label, a.room-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

a:link {
    color: black;
    text-decoration: none;
}

a:hover {
    color: black;
    text-decoration: none;
}

a:visited {
    text-decoration: none;
    color: black;
}

.form-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 28px;
}

.section-label {
    font-family: 'Press Start 2P', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-align: center;
    font-size: 20px;
}

.form-actions .btn { width: 100%; text-align: center; }

.error-msg {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: var(--red-bright);
    margin-top: 16px;
    display: none;
    text-align: center;
    line-height: 1.8;
}

/* ─── CARD ─── */
.card {
  width: var(--card-width);
  height: var(--card-height);
  background: var(--cream);
  border: 3px solid #000;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  image-rendering: pixelated;
  box-shadow: 3px 3px 0 #000;
}

.card:hover {
  transform: translateY(-14px) rotate(-2deg);
  box-shadow: 5px 8px 0 #000;
  z-index: 10;
}

.card.selected {
  transform: translateY(-20px);
  box-shadow: 0 0 0 3px var(--gold), 5px 8px 0 #000;
  z-index: 10;
}

.card-rank {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
  position: absolute;
  top: 5px;
  left: 6px;
}

.card-suit-center {
  font-size: 28px;
  line-height: 1;
}

.card-rank-bottom {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  position: absolute;
  bottom: 5px;
  right: 6px;
  transform: rotate(180deg);
}

.card.hearts .card-rank,
.card.hearts .card-rank-bottom,
.card.hearts .card-suit-center,
.card.diamonds .card-rank,
.card.diamonds .card-rank-bottom,
.card.diamonds .card-suit-center {
  color: var(--red);
}

.card.spades .card-rank,
.card.spades .card-rank-bottom,
.card.spades .card-suit-center,
.card.clubs .card-rank,
.card.clubs .card-rank-bottom,
.card.clubs .card-suit-center {
  color: #1a1a2e;
}

.card-back {
  background: var(--brown);
  cursor: default;
}
.card-back::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 4px,
    transparent 4px,
    transparent 8px
  );
}
