/* ===================================================
   SOC-PANIC Digital Game – Unified Stylesheet
   =================================================== */

/* =========================
   RESET & GLOBAL
   ========================= */
/* --- AI WARFARE EXPANSION --- */
.role-card--ai:not(.locked) {
    border-color: #00ffff !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}
.role-card--ai.selected {
    background: rgba(0, 255, 255, 0.15) !important;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5) !important;
}

#ai-settings {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================
   LOBBY WIZARD
   ========================= */
.lobby-step {
    margin-bottom: 30px;
    transition: all 0.4s ease;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.lobby-step--disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(0.8) blur(1px);
}

.lobby-step--active {
    background: rgba(0, 255, 255, 0.05);
    border-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
}

.is-visible {
    display: block !important;
}

.step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.step-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-check {
    display: none;
    color: #4caf50;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: check-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes check-pop {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.step-header span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #00ffff;
    color: #000;
    border-radius: 50%;
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.start-btn {
    background: linear-gradient(135deg, #00ffff, #008080);
    color: #000;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 255, 0.4);
}

.lobby-guidance {
    background: rgba(242, 140, 40, 0.1);
    border-left: 4px solid #f28c28;
    padding: 10px 15px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    border-radius: 4px;
    color: #f28c28;
    animation: pulse-guidance 2s infinite ease-in-out;
}

@keyframes pulse-guidance {
    0% { background: rgba(242, 140, 40, 0.1); }
    50% { background: rgba(242, 140, 40, 0.2); }
    100% { background: rgba(242, 140, 40, 0.1); }
}

.mode-picker {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mode-picker .divider {
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.5;
    position: relative;
}

.mode-picker .divider::before,
.mode-picker .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.mode-picker .divider::before { left: 0; }
.mode-picker .divider::after { right: 0; }

.difficulty-option {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.role-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 120px;
}

.role-option img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.2));
}

.role-option span {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
}

.role-option.selected {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.role-option.selected span {
    color: #00ffff;
}

.difficulty-option.selected {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.diff-title {
    font-weight: 700;
    font-size: 0.8rem;
}

.diff-desc {
    font-size: 0.6rem;
    opacity: 0.6;
}

/* Expansion Card Styles */
.card-category-ai-offensive {
    color: #ff00ff;
    text-shadow: 0 0 5px #ff00ff;
}
.card-category-neural-defense {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #000;
  color: #fff;
  overflow-x: hidden;
  line-height: 1.4;
}

/* =========================
   BACKGROUND LAYERS
   ========================= */
body::before {
  content: "";
  position: fixed;
  top: 50%; left: 50%;
  width: 140vw; height: 140vh;
  background: url("../images/soc-panic_logo_background_04.png") no-repeat center center;
  background-size: cover;
  opacity: 0.12;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  top: 50%; left: 50%;
  width: 120vw; height: 120vh;
  background: url("../images/soc-panic_logo_02.png") no-repeat center center;
  background-size: contain;
  opacity: 0.18;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
}

/* =========================
   PAGE LAYOUT
   ========================= */
.page-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 40px 0 30px;
  padding-top: calc(env(safe-area-inset-top, 20px) + 20px);
}

.inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 8px;
}

.inner--wide {
  max-width: 900px;
}

.inner--medium {
  max-width: 800px;
}

.inner--lobby {
  max-width: 520px;
}

.lobby-header {
    padding-top: calc(env(safe-area-inset-top) + 15px);
    margin-bottom: 20px;
    z-index: 100;
}

.logo-container {
    text-align: center;
    padding: 10px;
}

.lobby-logo {
    max-width: 140px;
    filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.3));
}

/* =========================
   STATUS HEADER (base)
   ========================= */
.status-header {
  border-radius: 18px;
  border: 2px solid #f28c28;
  box-shadow: 0 0 18px rgba(242,140,40,0.45);
  background: radial-gradient(circle at top left, rgba(242,140,40,0.25), rgba(0,0,0,0.9));
  padding: 14px 16px 16px;
  margin-top: 16px;
  margin-bottom: 12px;
  position: relative;
  overflow: visible;
}

.status-header--soc {
  border-color: #00C6A3;
  box-shadow: 0 0 18px rgba(0,198,163,0.45);
  background: radial-gradient(circle at top left, rgba(0,198,163,0.25), rgba(0,0,0,0.9));
}

.status-header--apt {
  border-color: #ff4b81;
  box-shadow: 0 0 20px rgba(255,75,129,0.5);
  background: radial-gradient(circle at top left, rgba(255,75,129,0.35), rgba(0,0,0,0.92));
}

.status-header--gm {
  border-color: #f28c28;
  box-shadow: 0 0 18px rgba(242,140,40,0.45);
  background: radial-gradient(circle at top left, rgba(242,140,40,0.25), rgba(0,0,0,0.9));
}

.status-header--cyrem {
  border-color: #ffc866;
  box-shadow: 0 0 18px rgba(255,200,102,0.45);
  background: radial-gradient(circle at top left, rgba(255,200,102,0.25), rgba(0,0,0,0.9));
}

.status-header--active {
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.4), inset 0 0 20px rgba(255, 255, 255, 0.1);
  border-color: #fff !important;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { border-color: rgba(255,255,255,0.6); }
  50% { border-color: rgba(255,255,255,1); box-shadow: 0 0 35px rgba(255, 255, 255, 0.6), inset 0 0 25px rgba(255, 255, 255, 0.2); }
  100% { border-color: rgba(255,255,255,0.6); }
}

.header-top {
    padding-top: env(safe-area-inset-top);
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}

/* Guidance & Idiot-Proofing */
.phase-guidance-card {
    background: linear-gradient(135deg, #f28c28, #d4761a);
    color: #000;
    padding: 15px 20px;
    font-weight: 800;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 15px rgba(242,140,40,0.3);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    animation: slideDownFade 0.4s ease-out;
}

.phase-guidance-card--wait {
    background: linear-gradient(135deg, #333, #222);
    color: #888;
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

@keyframes slideDownFade {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Income Overview Styles */
.income-overlay-content {
    background: rgba(0,0,0,0.95);
    border: 2px solid #f28c28;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 0 40px rgba(242,140,40,0.4);
    text-align: center;
}

.income-table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
}

.income-table tr {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.income-table td {
    padding: 12px 0;
    font-size: 1.1rem;
}

.income-table td:last-child {
    text-align: right;
    font-weight: 800;
    color: #39ff14;
}

.income-total {
    font-size: 2rem !important;
    color: #f28c28 !important;
}

.guidance-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.wait-overlay {
    position: fixed;
    top: 180px; /* Below header */
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.wait-overlay-msg {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.8);
    padding: 20px 40px;
    border: 2px solid #555;
    border-radius: 12px;
}

.action-btn--prominent {
    background: #00ffff !important;
    color: #000 !important;
    font-size: 1.2rem !important;
    font-weight: 900 !important;
    padding: 18px 30px !important;
    box-shadow: 0 0 25px rgba(0,255,255,0.5) !important;
    transform: scale(1.05);
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 10px rgba(0,255,255,0.4); }
    to { box-shadow: 0 0 30px rgba(0,255,255,0.8); }
}

.turn-indicator {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: none;
  border-radius: 0 0 10px 10px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  z-index: 10;
  white-space: nowrap;
  pointer-events: none;
  transition: all 0.3s ease;
}

.turn-indicator--active {
  background: #fff;
  color: #000;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
  border-color: #fff;
}

.status-header-guidance {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.guidance-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 1px;
}

.status-header-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 8px;
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
}

.status-header-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-subline {
  margin: 4px 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Integrated Target Display in Status Header */
.status-header-target {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 0;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
  transition: transform 0.2s ease, border-color 0.2s ease;
  gap: 6px;
  min-width: 0; /* Allows shrinking */
}

.status-header-compact-pills {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.compact-pill {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .compact-pill {
    padding: 3px 6px;
    gap: 4px;
    font-size: 0.7rem;
  }
}

.compact-pill-label {
  opacity: 0.7;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
}

.compact-pill-value {
  font-weight: 800;
  color: #fff;
}

.status-header-target[onclick]:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

.target-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.target-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(242,140,40,0.6));
}

.target-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: #fff;
}

.target-status {
  text-align: right;
}

.target-status-label {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 2px;
  text-transform: none;
}

.target-stage {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
}

/* =========================
   STATUS PILLS
   ========================= */
.pill {
  flex: 1 1 calc(50% - 4px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  padding: 8px 12px;
  border: 2px solid rgba(242,140,40,0.4);
  background: rgba(0,0,0,0.7);
  font-size: 0.9rem;
}

.pill-label { opacity: 0.9; }

.pill-value {
  font-weight: 800;
  color: #f28c28;
  text-shadow: 0 0 8px rgba(242,140,40,0.7);
}

/* Status Header Info (bottom row) */
.status-header-info {
  margin-top: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px; /* Pill shape like above */
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.5);
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.3;
}

.timer-warning-pulse {
  animation: timer-warning-glow 1s infinite alternate;
  background: rgba(255, 0, 0, 0.3) !important;
  border-color: #ff4444 !important;
}

@keyframes timer-warning-glow {
  from { box-shadow: 0 0 5px rgba(255, 68, 68, 0.4); }
  to { box-shadow: 0 0 15px rgba(255, 68, 68, 0.8); }
}

.auto-follow-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  user-select: none;
}

.auto-follow-label:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.auto-follow-label input {
  margin: 0;
  cursor: pointer;
  accent-color: var(--soc);
}

.status-header-info--soc {
  border-color: rgba(0,198,163,0.4);
  color: #e0fff4;
  text-shadow: 0 0 5px rgba(0,198,163,0.4);
}

.status-header-info--apt {
  border-color: rgba(255,75,129,0.5);
  color: #ffe0ed;
  text-shadow: 0 0 5px rgba(255,75,129,0.4);
}

/* SOC variant */
.pill--soc { border-color: rgba(0,198,163,0.4); }
.pill--soc .pill-value { color: #00ff99; text-shadow: 0 0 8px rgba(0,255,153,0.7); }
.pill--soc.phase .pill-value { color: #00C6FF; }

/* APT variant */
.pill--apt { border-color: rgba(255,75,129,0.5); background: rgba(0,0,0,0.78); }
.pill--apt .pill-value { color: #ff80c4; text-shadow: 0 0 8px rgba(255,128,196,0.8); }
.pill--apt.phase .pill-value { color: #ffdf6b; }

/* GM variant */
.pill--gm { border-color: rgba(242,140,40,0.4); }
.pill--gm .pill-value { color: #f28c28; text-shadow: 0 0 8px rgba(242,140,40,0.7); }

/* CYREM variant */
.pill--cyrem { border-color: rgba(255,200,102,0.4); }
.pill--cyrem .pill-value { color: #ffc866; text-shadow: 0 0 8px rgba(255,200,102,0.7); }

/* Spectator variant */
.pill--spectator { border-color: rgba(52,152,219,0.4); }
.pill--spectator .pill-value { color: #5dade2; text-shadow: 0 0 8px rgba(52,152,219,0.7); }

/* Opponent info pills (tinted) */
.pill--enemy-apt { border-color: rgba(255,75,129,0.3); }
.pill--enemy-apt .pill-value { color: #ff7777; }
.pill--enemy-soc { border-color: rgba(0,198,163,0.3); }
.pill--enemy-soc .pill-value { color: #00ff99; }

/* =========================
   SECTION TITLES
   ========================= */
.section-title {
  margin: 12px 2px 6px;
  font-size: 1.1rem;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0,0,0,0.8);
}

/* =========================
   MINI-CARD GRID
   ========================= */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.mini-card {
  width: 100%;
  height: 92px;
  border-radius: 14px;
  padding: 6px 6px 8px;
  border: 2px solid #6bcf63;
  background: rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(0,0,0,0.6);
  cursor: pointer;
  transition: 0.15s ease;
  color: #fff;
  text-align: left;
  font-family: inherit;
}

.mini-card:hover,
.mini-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255,255,255,0.25);
}

.mini-card.selected {
  box-shadow: 0 0 18px rgba(255,255,255,0.5);
  transform: translateY(-4px);
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.mini-card-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  line-height: 0.9rem;
  white-space: nowrap;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-card-icon {
  width: 16px; height: 16px;
  object-fit: contain;
}

.mini-card-title {
  height: 28px;
  line-height: 1.05rem;
  font-size: 0.78rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-card-cost {
  font-size: 0.72rem;
  line-height: 0.9rem;
  height: 14px;
  opacity: 0.85;
}

.mini-card-stage {
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: auto;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.mini-card-stage--recon   { background: #1565c0; color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.mini-card-stage--lateral { background: #e65100; color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.mini-card-stage--impact  { background: #b71c1c; color: #fff; border: 1px solid rgba(255,255,255,0.3); }

/* Mini-card category colors */
.mini-card.defense    { border-color: #6bcf63; }
.mini-card.tool       { border-color: #1a1aff; }
.mini-card.event      { border-color: #f45b5b; }
.mini-card.insider    { border-color: #f2c94c; }
.mini-card.management { border-color: #9ef014; }
.mini-card.bug        { border-color: #ff6b35; }
.mini-card.apttool    { border-color: #ff4b81; }
.mini-card.apttarget  { border-color: #ffdf6b; }

/* =========================
   FULL CARD
   ========================= */
.card {
  position: relative;
  width: 100%;
  max-width: 320px;
  min-height: 0;
  border-radius: 22px;
  overflow: hidden;
  color: #f5f7fa;
  display: flex;
  flex-direction: column;
  background: #021015 url("../images/background01.png") center/cover no-repeat;
  box-shadow: 0 0 18px rgba(0,0,0,0.7);
  transition: transform .25s ease, box-shadow .25s ease;
  border: 4px solid #f28c28;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.14);
  z-index: 1;
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 8px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-header-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.card-cost-badge {
  min-width: 32px; height: 32px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 2px solid currentColor;
  font-size: 1rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

.card-category-title {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.95;
  padding: 0 4px;
}

.card-header-icon {
  width: 36px; height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0,0,0,0.7));
}

.card-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 4px 0;
  text-align: center;
  line-height: 1.15;
}

.card-body {
  margin-top: 4px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.75);
  border: 2px solid var(--meta-color, #00faff);
  border-radius: 10px;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.03) 0px,
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.35;
}

.card-bottom-row {
  position: relative;
  z-index: 2;
  margin: 0 18px 16px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card-footer-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #e0e6ee;
}

.card-points-circle {
  min-width: 32px; height: 32px;
  border-radius: 999px;
  border: 2px solid currentColor;
  display: flex; justify-content: center; align-items: center;
  font-weight: 700; font-size: 1rem;
  background: rgba(4,21,28,0.9);
}

/* Card type colors */
.card-defense    { border-color: #6bcf63; box-shadow: 0 0 20px rgba(107,207,99,0.28); --meta-color:#6bcf63; }
.card-tool       { border-color: #1a1aff; box-shadow: 0 0 20px rgba(26,26,255,0.35);  --meta-color:#1a1aff; }
.card-event      { border-color: #f45b5b; box-shadow: 0 0 20px rgba(244,91,91,0.35);   --meta-color:#f45b5b; }
.card-management { border-color: #9ef014; box-shadow: 0 0 20px rgba(158,240,20,0.35);  --meta-color:#9ef014; }
.card-insider    { border-color: #f2c94c; box-shadow: 0 0 20px rgba(242,201,76,0.35);  --meta-color:#f2c94c; }
.card-bug        { border-color: #ff6b35; box-shadow: 0 0 20px rgba(255,107,53,0.35);  --meta-color:#ff6b35; }
.card-apttool    { border-color: #ff4b81; box-shadow: 0 0 20px rgba(255,75,129,0.4);   --meta-color:#ff4b81; }
.card-apttarget  { border-color: #ffdf6b; box-shadow: 0 0 20px rgba(255,223,107,0.4);  --meta-color:#ffdf6b; }

/* Dice block */
.card-dice-flex {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  background: rgba(0,0,0,0.75);
  border: 2px solid var(--meta-color, #00faff);
  border-radius: 10px;
  padding: 10px 14px;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.04) 0px,
    rgba(255,255,255,0.04) 1px,
    transparent 1px,
    transparent 3px
  );
  color: #ffffff;
}

.dice-icon { font-size: 2rem; line-height: 1; margin-top: 4px; }
.dice-lines div { font-size: 0.85rem; line-height: 1.25; }

/* =========================
   PANELS
   ========================= */
.panel {
  border-radius: 16px;
  border: 2px solid #f28c28;
  padding: 10px 12px 12px;
  margin-top: 10px;
  background: rgba(0,0,0,0.8);
  box-shadow: 0 0 16px rgba(242,140,40,0.35);
  font-size: 0.95rem;
}

.target-panel--clickable:hover {
  transform: scale(1.02);
  filter: brightness(1.2);
}
.target-panel--clickable:active {
  transform: scale(0.98);
}

.panel--soc {
  border-color: #00C6A3;
  box-shadow: 0 0 16px rgba(0,198,163,0.35);
}

.panel--apt {
  border-color: #ff4b81;
  box-shadow: 0 0 16px rgba(255,75,129,0.35);
}

.panel--gm {
  border-color: #f28c28;
  box-shadow: 0 0 16px rgba(242,140,40,0.35);
}

.panel--cyrem {
  border-color: #ffc866;
  box-shadow: 0 0 16px rgba(255,200,102,0.35);
}

.panel-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.effect-list {
  margin: 0;
  padding-left: 18px;
}

.effect-list li { margin-bottom: 3px; }

.panel-collapsible {
  margin-bottom: 12px;
}

.panel-collapsible .panel-body {
  overflow: hidden;
  max-height: 500px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel-collapsible.collapsed .panel-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.panel-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-toggle::after {
  content: "\25BC";
  font-size: 0.7rem;
  opacity: 0.6;
  transition: transform 0.3s;
}

.panel-collapsible.collapsed .panel-toggle::after {
  transform: rotate(-90deg);
}

/* =========================
   CARD OVERLAY
   ========================= */
.card-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}

.card-overlay.active { display: flex; }

.card-overlay-inner {
  position: relative;
  max-width: min(420px, 94vw);
  width: 94vw;
}

.overlay-close {
  display: none;
}

.overlay-card-slot .card {
  max-width: 100%;
  width: 100%;
}

/* =========================
   PHASE ACTION BAR
   ========================= */
.phase-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.phase-btn {
  flex: 1 1 auto;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: center;
}

.phase-btn:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.phase-btn--primary {
  border-color: #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
}

.phase-btn--primary:hover {
  background: rgba(242,140,40,0.35);
}

.phase-btn--soc {
  border-color: #00C6A3;
  background: rgba(0,198,163,0.15);
  color: #00ff99;
}

.phase-btn--apt {
  border-color: #ff4b81;
  background: rgba(255,75,129,0.15);
  color: #ff80c4;
}

.phase-btn--disabled {
  opacity: 1;
  pointer-events: none;
  background: #444 !important;
  border-color: #666 !important;
  color: #888 !important;
  box-shadow: none !important;
}

/* =========================
   SHOP PANEL
   ========================= */
.shop-panel {
  margin: 8px 0;
}

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

.shop-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.7);
  cursor: pointer;
  transition: 0.15s ease;
  min-width: 0;
}

.shop-item:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-1px);
}

.shop-item-icon {
  width: 28px; height: 28px;
  object-fit: contain;
}

.shop-item-name {
  font-size: 0.75rem;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item-cost {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
}

.shop-item--disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.6);
}

/* =========================
   TARGET TRACKER
   ========================= */
.target-panel {
  position: relative;
  z-index: 1;
  border-radius: 16px;
  border: 2px solid #ff4b81;
  background: rgba(0,0,0,0.88);
  box-shadow: 0 0 18px rgba(255,75,129,0.45);
  padding: 10px 12px 12px;
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.target-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.target-icon { width: 22px; height: 22px; object-fit: contain; }
.target-title { font-weight: 700; font-size: 0.85rem; }
.target-sub { font-size: 0.85rem; opacity: 0.9; }

.target-stage-label {
  margin-top: 6px;
  font-size: 0.85rem;
  opacity: 0.95;
}

.stage-track {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}

.stage-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #555;
  background: rgba(0,0,0,0.7);
  flex-shrink: 0;
}

.stage-label { opacity: 0.9; }

.stage-row.done .stage-dot {
  border-color: #ff4b81;
  background: #ff4b81;
}

.stage-row.current .stage-dot {
  border-color: #ffdf6b;
  background: #ffdf6b;
  box-shadow: 0 0 8px rgba(255,223,107,0.8);
}

.stage-row.current .stage-label {
  color: #ffdf6b;
  font-weight: 700;
}

.stage-row.optional .stage-label::after {
  content: " (optional)";
  opacity: 0.8;
  font-weight: 400;
}

.stage-advance-btn {
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 2px solid #ffdf6b;
  background: rgba(255,223,107,0.15);
  color: #ffdf6b;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.stage-advance-btn:hover {
  background: rgba(255,223,107,0.3);
}

/* =========================
   SYNERGY CHAIN (APT)
   ========================= */
.synergy-chain {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 8px 0;
}

.synergy-box {
  flex: 1;
  padding: 8px 6px;
  text-align: center;
  border-radius: 10px;
  border: 2px solid rgba(255,75,129,0.3);
  background: rgba(0,0,0,0.7);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.synergy-box.active {
  border-color: #ff4b81;
  background: rgba(255,75,129,0.2);
  color: #ff80c4;
  box-shadow: 0 0 10px rgba(255,75,129,0.3);
}

.synergy-arrow {
  font-size: 1rem;
  opacity: 0.5;
  padding: 0 4px;
  flex-shrink: 0;
}

/* =========================
   COUNTER BUTTON
   ========================= */
.counter-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 3px solid #ff3333;
  background: rgba(255,51,51,0.15);
  color: #ff5555;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.2s ease;
  margin: 8px 0;
  text-align: center;
}

.counter-btn:hover {
  background: rgba(255,51,51,0.3);
  box-shadow: 0 0 20px rgba(255,51,51,0.4);
  transform: scale(1.02);
}

.counter-btn--soc {
  border-color: #00C6A3;
  background: rgba(0,198,163,0.15);
  color: #00ff99;
}

.counter-btn--soc:hover {
  background: rgba(0,198,163,0.3);
  box-shadow: 0 0 20px rgba(0,198,163,0.4);
}

/* =========================
   PLAY ZONE
   ========================= */
.play-zone {
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 20px;
  margin: 10px 0;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
}

.play-zone-label {
  font-size: 0.85rem;
  opacity: 0.5;
  font-weight: 600;
}

.play-zone.has-card {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}

.play-zone .play-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: 2px solid #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.play-zone .play-btn:hover {
  background: rgba(242,140,40,0.35);
}

/* =========================
   GAME LOG (GameMaster)
   ========================= */
.game-log {
  max-height: 300px;
  overflow-y: auto;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.85);
  padding: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

.game-log-entry {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  gap: 8px;
}

.game-log-entry:last-child { border-bottom: none; }

.log-time {
  color: #888;
  white-space: nowrap;
  flex-shrink: 0;
}

.log-msg { flex: 1; }
.log-msg--soc { color: #00ff99; }
.log-msg--apt { color: #ff80c4; }
.log-msg--system { color: #f28c28; }
.log-msg--cyrem { color: #ffc866; }

/* =========================
   TIMER DISPLAY
   ========================= */
.timer-display {
  font-family: 'Courier New', monospace;
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  padding: 16px;
  letter-spacing: 0.1em;
  color: #f28c28;
  text-shadow: 0 0 20px rgba(242,140,40,0.5);
}

.timer-display.warning { color: #ff5555; text-shadow: 0 0 20px rgba(255,85,85,0.5); }

.timer-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.timer-btn {
  padding: 8px 20px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.timer-btn:hover { background: rgba(255,255,255,0.15); }
.timer-btn--start { border-color: #00ff99; color: #00ff99; }
.timer-btn--pause { border-color: #f28c28; color: #f28c28; }
.timer-btn--reset { border-color: #ff5555; color: #ff5555; }

/* =========================
   PHASE CONTROL (GameMaster)
   ========================= */
.phase-control {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.phase-control-btn {
  flex: 1 1 auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: center;
}

.phase-control-btn:hover { background: rgba(255,255,255,0.1); }

.phase-control-btn.active {
  border-color: #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
}

.phase-next-btn {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
  margin-top: 6px;
  text-align: center;
}

.phase-next-btn:hover {
  background: rgba(242,140,40,0.35);
  box-shadow: 0 0 16px rgba(242,140,40,0.3);
}

/* =========================
   SCENARIO GRID (CYREM)
   ========================= */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.scenario-card {
  padding: 12px;
  border-radius: 14px;
  border: 2px solid rgba(255,200,102,0.3);
  background: rgba(0,0,0,0.75);
  cursor: pointer;
  transition: 0.15s ease;
}

.scenario-card:hover {
  border-color: #ffc866;
  background: rgba(255,200,102,0.08);
  transform: translateY(-2px);
}

.scenario-card.selected {
  border-color: #ffc866;
  background: rgba(255,200,102,0.15);
  box-shadow: 0 0 14px rgba(255,200,102,0.3);
}

.scenario-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.scenario-card-desc {
  font-size: 0.75rem;
  opacity: 0.7;
  line-height: 1.3;
}

.scenario-card-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 6px;
}

.scenario-card-badge--complex {
  background: rgba(255,75,129,0.2);
  color: #ff80c4;
  border: 1px solid rgba(255,75,129,0.3);
}

.scenario-card-badge--simple {
  background: rgba(0,198,163,0.2);
  color: #00ff99;
  border: 1px solid rgba(0,198,163,0.3);
}

/* =========================
   INJECT BUTTONS (CYREM)
   ========================= */
.inject-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.inject-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #ff5555;
  background: rgba(255,85,85,0.12);
  color: #ff7777;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.inject-btn:hover {
  background: rgba(255,85,85,0.25);
  box-shadow: 0 0 12px rgba(255,85,85,0.3);
}

.inject-btn--warning {
  border-color: #f28c28;
  background: rgba(242,140,40,0.12);
  color: #f28c28;
}

.inject-btn--warning:hover {
  background: rgba(242,140,40,0.25);
}

/* =========================
   EVAL CHECKLIST (CYREM)
   ========================= */
.eval-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.eval-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}

.eval-checklist li:last-child { border-bottom: none; }

.eval-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.eval-toggle input {
  opacity: 0;
  width: 0; height: 0;
}

.eval-toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: 0.2s;
}

.eval-toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #888;
  transition: 0.2s;
}

.eval-toggle input:checked + .eval-toggle-slider {
  background: rgba(0,198,163,0.3);
}

.eval-toggle input:checked + .eval-toggle-slider::before {
  transform: translateX(18px);
  background: #00ff99;
}

/* =========================
   LOBBY
   ========================= */
.lobby-logo {
  display: block;
  max-width: 200px;
  margin: 20px auto 10px;
}

.lobby-form {
  margin: 16px 0;
}

.lobby-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.2s;
}

.lobby-input:focus {
  border-color: #f28c28;
}

.lobby-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.lobby-btn-group {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lobby-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
  text-align: center;
}

.lobby-btn:hover {
  background: rgba(255,255,255,0.12);
}

.lobby-btn.active {
  border-color: #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
}

/* =========================
   ROLE PICKER
   ========================= */
.role-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 12px 0;
}

.role-card {
  position: relative;
  padding: 16px 12px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.7);
  text-align: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.role-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 14px rgba(255,255,255,0.15);
}

.role-card.selected {
  outline: 3px solid #fff;
  outline-offset: 2px;
  transform: scale(1.05);
}

.role-card.selected::after {
  content: '\2713';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
}

.role-card--soc {
  border-color: #00C6A3;
}

.role-card--soc.selected {
  background: rgba(0,198,163,0.15);
  box-shadow: 0 0 18px rgba(0,198,163,0.4);
}

.role-card--apt {
  border-color: #ff4b81;
}

.role-card--apt.selected {
  background: rgba(255,75,129,0.15);
  box-shadow: 0 0 18px rgba(255,75,129,0.4);
}

.role-card--ai {
  border-color: #00ffff;
}

.role-card--ai.selected {
  background: rgba(0,255,255,0.15);
  box-shadow: 0 0 18px rgba(0,255,255,0.4);
}

.role-card--gm {
  border-color: #f28c28;
}

.role-card--gm.selected {
  background: rgba(242,140,40,0.15);
  box-shadow: 0 0 18px rgba(242,140,40,0.4);
}

.role-card--cyrem {
  border-color: #ffc866;
}

.role-card--cyrem.selected {
  background: rgba(255,200,102,0.15);
  box-shadow: 0 0 18px rgba(255,200,102,0.4);
}

.role-card--spectator {
  border-color: #3498db;
}

.role-card--spectator.selected {
  background: rgba(52,152,219,0.15);
  box-shadow: 0 0 18px rgba(52,152,219,0.4);
}

/* ── Spectator Mode ──────────────────────────── */

.spectator-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(52,152,219,0.15);
  border: 1px solid rgba(52,152,219,0.3);
  border-radius: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.spectator-switcher-label {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.8;
  margin-right: 4px;
}

.spectator-btn {
  padding: 6px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.spectator-btn:hover {
  background: rgba(52,152,219,0.2);
  border-color: rgba(52,152,219,0.5);
}

.spectator-btn.active {
  background: rgba(52,152,219,0.35);
  border-color: #3498db;
  box-shadow: 0 0 8px rgba(52,152,219,0.3);
}

.spectator-mode .phase-btn,
.spectator-mode .shop-buy-btn,
.spectator-mode .ready-btn,
.spectator-mode .card-actions,
.spectator-mode .discard-btn,
.spectator-mode .timer-controls,
.spectator-mode .phase-next-btn,
.spectator-mode .phase-control,
.spectator-mode button[onclick*="advancePhase"],
.spectator-mode button[onclick*="playCard"],
.spectator-mode button[onclick*="buyCard"],
.spectator-mode button[onclick*="ready"],
.spectator-mode button[onclick*="discard"],
.spectator-mode button[onclick*="counter"],
.spectator-mode button[onclick*="endGame"],
.spectator-mode button[onclick*="EmergencyCredit"] {
  display: none !important;
}

.role-card--ai {
  border-color: #9b59b6;
}

.role-card-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.role-card-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}

.role-card-desc {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* =========================
   GAME CODE
   ========================= */
.game-code {
  font-family: 'Courier New', monospace;
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.3em;
  color: #f28c28;
  text-shadow: 0 0 20px rgba(242,140,40,0.5);
  padding: 16px;
  border: 2px solid rgba(242,140,40,0.3);
  border-radius: 16px;
  background: rgba(0,0,0,0.6);
  margin: 12px 0;
}

.game-code-label {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 4px;
}

/* =========================
   ENDSCREEN
   ========================= */
.endscreen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px 20px 20px;
  padding-top: calc(env(safe-area-inset-top, 20px) + 40px);
}

.endscreen-title {
  font-size: 8vw;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  line-height: 1.1;
}

@media (min-width: 480px) {
  .endscreen-title {
    font-size: 2.8rem;
    letter-spacing: 0.15em;
  }
}

.endscreen-subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 24px;
}

.endscreen-icon {
  font-size: 5rem;
  margin-bottom: 16px;
}

/* APT wins */
.endscreen--apt .endscreen-title {
  color: #ff4b81;
  text-shadow: 0 0 30px rgba(255,75,129,0.6);
  animation: pulse-apt 2s ease-in-out infinite;
}

.endscreen--apt .endscreen-icon {
  animation: pulse-apt 2s ease-in-out infinite;
}

/* SOC wins */
.endscreen--soc .endscreen-title {
  color: #00ff99;
  text-shadow: 0 0 30px rgba(0,255,153,0.6);
  animation: pulse-soc 2s ease-in-out infinite;
}

.endscreen--soc .endscreen-icon {
  animation: pulse-soc 2s ease-in-out infinite;
}

@keyframes pulse-apt {
  0%, 100% { text-shadow: 0 0 30px rgba(255,75,129,0.6); }
  50% { text-shadow: 0 0 60px rgba(255,75,129,0.9), 0 0 100px rgba(255,75,129,0.4); }
}

@keyframes pulse-soc {
  0%, 100% { text-shadow: 0 0 30px rgba(0,255,153,0.6); }
  50% { text-shadow: 0 0 60px rgba(0,255,153,0.9), 0 0 100px rgba(0,255,153,0.4); }
}

.endscreen-stats {
  width: 100%;
  max-width: 360px;
  margin: 20px auto;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.7);
  padding: 16px;
}

.endscreen-stats h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  opacity: 0.8;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9rem;
}

.stat-row:last-child { border-bottom: none; }
.stat-value { font-weight: 700; }

.endscreen-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.endscreen-btn {
  padding: 14px 32px;
  border-radius: 14px;
  border: 2px solid #f28c28;
  background: rgba(242,140,40,0.2);
  color: #f28c28;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s ease;
}

.endscreen-btn:hover {
  background: rgba(242,140,40,0.35);
  box-shadow: 0 0 16px rgba(242,140,40,0.3);
}

.endscreen-link {
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
}

/* =========================
   GM TWO-COLUMN LAYOUT
   ========================= */
.gm-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.gm-full-width {
  grid-column: 1 / -1;
}

/* =========================
   GM CARD BROWSER
   ========================= */
.card-browser-search {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  margin-bottom: 8px;
  outline: none;
}

.card-browser-search:focus { border-color: #f28c28; }

.card-browser-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.card-browser-tab {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.card-browser-tab:hover { background: rgba(255,255,255,0.1); }
.card-browser-tab.active {
  border-color: #f28c28;
  background: rgba(242,140,40,0.15);
  color: #f28c28;
}

.card-browser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

/* =========================
   RULE REFERENCE (collapsible)
   ========================= */
.rule-section {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0;
}

.rule-section:last-child { border-bottom: none; }

.rule-section-title {
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.rule-section-title::after {
  content: "+";
  font-size: 1rem;
  opacity: 0.5;
}

.rule-section.open .rule-section-title::after { content: "-"; }

.rule-section-body {
  display: none;
  padding: 6px 0 6px 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  opacity: 0.85;
}

.rule-section.open .rule-section-body { display: block; }

/* =========================
   FLOATING BUTTON
   ========================= */
.floating-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: 999px;
  border: 2px solid #f28c28;
  background: rgba(0,0,0,0.9);
  color: #f28c28;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  transition: 0.15s ease;
}

.floating-btn:hover {
  background: rgba(242,140,40,0.2);
  box-shadow: 0 0 20px rgba(242,140,40,0.3);
}

/* =========================
   NOTES AREA (CYREM)
   ========================= */
.notes-area {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid rgba(255,200,102,0.3);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

.notes-area:focus {
  border-color: #ffc866;
}

/* =========================
   ENDSCREEN TOGGLE (preview)
   ========================= */
.preview-toggles {
  position: fixed;
  top: 10px; right: 10px;
  z-index: 100;
  display: flex;
  gap: 6px;
}

.preview-toggle {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
}

.preview-toggle.active {
  border-color: #f28c28;
  background: rgba(242,140,40,0.2);
}

/* =========================
   FOOTER
   ========================= */
.game-footer {
  text-align: center;
  padding: 20px 0;
  font-size: 0.8rem;
  opacity: 0.4;
}

/* =========================
   SETUP WAITING STATE (SOC)
   ========================= */
.setup-waiting {
  text-align: center;
  padding: 24px 16px;
  border-radius: 16px;
  border: 2px solid rgba(0,198,163,0.35);
  background: rgba(0,198,163,0.08);
  margin: 16px 0;
  animation: setup-pulse 2.5s ease-in-out infinite;
}

.setup-waiting-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.setup-waiting-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #00ff99;
  text-shadow: 0 0 10px rgba(0,255,153,0.4);
}

.setup-waiting-sub {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-top: 6px;
}

@keyframes setup-pulse {
  0%, 100% { border-color: rgba(0,198,163,0.35); box-shadow: 0 0 12px rgba(0,198,163,0.15); }
  50% { border-color: rgba(0,198,163,0.6); box-shadow: 0 0 24px rgba(0,198,163,0.3); }
}

.hand-disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}

/* Phase infobox */
.phase-infobox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 6px 0 12px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.phase-infobox--soc {
  border-color: rgba(0,198,163,0.3);
  background: rgba(0,198,163,0.06);
}

.phase-infobox--apt {
  border-color: rgba(255,75,129,0.3);
  background: rgba(255,75,129,0.06);
}

.phase-infobox-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.phase-infobox-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.phase-infobox-text {
  font-size: 0.8rem;
  opacity: 0.7;
  line-height: 1.3;
}

/* Income breakdown */
.income-breakdown {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 4px;
  border-left: 3px solid rgba(255,255,255,0.2);
}
.income-breakdown--soc { border-left-color: var(--soc); }
.income-breakdown--apt { border-left-color: var(--apt); }

.income-breakdown-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.9;
}

.income-breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.income-breakdown-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 3px 0;
  opacity: 0.8;
}

.income-breakdown-amount {
  font-weight: 700;
  color: #4caf50;
}

.income-breakdown-total {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 800;
  padding-top: 6px;
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* Phase readiness hints */
.phase-ready-hint {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  display: inline-block;
}

.phase-ready-hint--waiting {
  border-color: rgba(0,198,163,0.5);
  background: rgba(0,198,163,0.1);
  color: #00ff99;
  animation: ready-pulse 1.5s ease-in-out infinite;
}

@keyframes ready-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0,198,163,0.2); }
  50% { box-shadow: 0 0 18px rgba(0,198,163,0.5); }
}

/* Disabled play-button hint in card overlay */
.play-disabled-hint {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: rgba(255,255,255,0.45);
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

/* =========================
   ROUND SUMMARY (CLEANUP)
   ========================= */
.round-summary {
  border-radius: 16px;
  border: 2px solid #f28c28;
  background: rgba(0,0,0,0.85);
  box-shadow: 0 0 18px rgba(242,140,40,0.3);
  padding: 14px 14px 16px;
  margin: 12px 0;
}

.round-summary--soc {
  border-color: #00C6A3;
  box-shadow: 0 0 18px rgba(0,198,163,0.3);
}

.round-summary--apt {
  border-color: #ff4b81;
  box-shadow: 0 0 18px rgba(255,75,129,0.3);
}

.rs-header {
  text-align: center;
  margin-bottom: 12px;
}

.rs-header-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.round-summary--soc .rs-header-title { color: #00ff99; }
.round-summary--apt .rs-header-title { color: #ff80c4; }

.rs-scores {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.rs-score {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

.rs-score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
}

.rs-score-value {
  font-size: 1.3rem;
  font-weight: 800;
}

.rs-score--soc .rs-score-value { color: #00ff99; }
.rs-score--apt .rs-score-value { color: #ff80c4; }
.rs-score--stage .rs-score-value { color: #ffdf6b; }

.rs-section {
  margin-top: 10px;
}

.rs-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.rs-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rs-entry {
  font-size: 0.78rem;
  padding: 3px 0 3px 12px;
  position: relative;
  line-height: 1.35;
}

.rs-entry::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}

.rs-entry--soc::before { background: #00ff99; }
.rs-entry--apt::before { background: #ff80c4; }
.rs-entry--system::before { background: #f28c28; }
.rs-entry--cyrem::before { background: #ffc866; }

.rs-entry--soc { color: rgba(0,255,153,0.85); }
.rs-entry--apt { color: rgba(255,128,196,0.85); }
.rs-entry--system { color: rgba(255,255,255,0.7); }

/* =========================
   CARD PLAYED NOTIFICATION
   ========================= */
.card-played-notif {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  z-index: 1000;
  width: 92%;
  max-width: 400px;
  border-radius: 16px;
  border: 2px solid #ff4b81;
  background: rgba(10, 5, 15, 0.95);
  backdrop-filter: blur(12px);
  padding: 14px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-played-notif.active {
  transform: translateX(-50%) translateY(0);
}

.card-played-notif--hostile {
  border: 3px solid #ff3b3b !important;
  animation: hostile-pulse 1.5s infinite ease-in-out;
  box-shadow: 0 0 40px rgba(255, 59, 59, 0.6) !important;
  background: rgba(30, 0, 0, 0.98) !important;
  max-width: 440px;
}

@keyframes hostile-pulse {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  50% { transform: translateX(-50%) translateY(10px) scale(1.05); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}

.card-played-notif--apt {
  border-color: #ff4b81;
  box-shadow: 0 8px 32px rgba(255,75,129,0.3);
}

.card-played-notif--soc {
  border-color: #00C6A3;
  box-shadow: 0 8px 32px rgba(0,198,163,0.3);
}

.cpn-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cpn-icon {
  font-size: 1.3rem;
}

.cpn-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-played-notif--apt .cpn-title { color: #ff80c4; }
.card-played-notif--soc .cpn-title { color: #00ff99; }
.card-played-notif--hostile .cpn-title { color: #ff3b3b !important; font-weight: 900; }

.cpn-card {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}

.cpn-card-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  margin-bottom: 2px;
}

.cpn-card-name {
  font-size: 1rem;
  font-weight: 800;
}

.cpn-card-text {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 4px;
  line-height: 1.3;
}

.cpn-effects {
  margin-top: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #ff7777;
  text-align: center;
}

.card-played-notif--soc .cpn-effects { color: #00ff99; }

.cpn-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.cpn-dismiss {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.cpn-counter-btn {
  flex: 1.5;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: #ffcc00;
  color: #000;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.4);
  transition: all 0.2s;
  text-transform: uppercase;
}

.cpn-counter-btn:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.5);
}
  cursor: pointer;
  transition: 0.15s ease;
}

.cpn-dismiss:hover {
  background: rgba(255,255,255,0.15);
}

.cpn-dismiss--apt {
  border-color: #ff4b81;
  color: #ff80c4;
}

.cpn-dismiss--apt:hover {
  background: rgba(255,75,129,0.2);
}

.cpn-dismiss--soc {
  border-color: #00C6A3;
  color: #00ff99;
}

.cpn-dismiss--soc:hover {
  background: rgba(0,198,163,0.2);
}

/* =========================
   UTILITY
   ========================= */
.text-soc { color: #00ff99; }
.text-apt { color: #ff80c4; }
.text-gm  { color: #f28c28; }
.text-cyrem { color: #ffc866; }
.text-muted { opacity: 0.6; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.hidden { display: none !important; }

/* =========================
   RESPONSIVE
   ========================= */
@media (min-width: 700px) {
  .inner { max-width: 640px; }
  .scenario-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .gm-columns {
    grid-template-columns: 1fr 1fr;
  }
}

/* Locked Role Cards */
.role-card.locked {
  filter: grayscale(1) opacity(0.4);
  pointer-events: none;
  cursor: not-allowed;
  border-color: #333 !important;
  box-shadow: none !important;
}

/* Invitation Modal Styles */
.invite-modal {
  background: rgba(10, 10, 10, 0.95);
  border: 2px solid #f28c28;
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 0 30px rgba(242, 140, 40, 0.3);
  text-align: center;
}

.qr-box {
  background: white;
  padding: 15px;
  border-radius: 16px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.qr-box img, .qr-box canvas {
  max-width: 100%;
  height: auto;
}

.invite-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.share-options {
  display: flex;
  gap: 12px;
}

.share-options .phase-btn {
  flex: 1;
}

.lobby-btn--invite {
  border-color: #f28c28;
  color: #f28c28;
  background: rgba(242, 140, 40, 0.1);
  padding: 8px 16px;
  font-size: 0.9rem;
}

.lobby-btn--invite:hover {
  background: rgba(242, 140, 40, 0.2);
  box-shadow: 0 0 15px rgba(242, 140, 40, 0.4);
}

/* =========================
   DICE ANIMATION
   ========================= */
.dice-overlay {
  text-align: center;
  padding: 20px;
}
.dice-overlay-title {
  font-size: 1.4rem;
  margin-bottom: 16px;
  color: #f5f7fa;
}

.dice-scene {
  width: 120px;
  height: 120px;
  margin: 24px auto;
  perspective: 400px;
}
.dice-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(30deg);
  transition: transform 0.4s ease-out;
}
.dice-face {
  position: absolute;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 3px solid #00faff;
  border-radius: 16px;
  box-shadow: inset 0 0 20px rgba(0, 250, 255, 0.15);
  backface-visibility: hidden;
}
.dice-face span {
  filter: drop-shadow(0 0 8px rgba(0, 250, 255, 0.6));
  color: #fff;
}
.dice-face--1 { transform: rotateY(0deg)   translateZ(60px); }
.dice-face--2 { transform: rotateY(90deg)  translateZ(60px); }
.dice-face--3 { transform: rotateY(180deg) translateZ(60px); }
.dice-face--4 { transform: rotateY(-90deg) translateZ(60px); }
.dice-face--5 { transform: rotateX(90deg)  translateZ(60px); }
.dice-face--6 { transform: rotateX(-90deg) translateZ(60px); }

.dice-rolling {
  animation: dice-tumble 2.5s linear infinite;
}
@keyframes dice-tumble {
  0%   { transform: rotateX(0deg)    rotateY(0deg)    rotateZ(0deg); }
  25%  { transform: rotateX(270deg)  rotateY(180deg)  rotateZ(90deg); }
  50%  { transform: rotateX(540deg)  rotateY(360deg)  rotateZ(180deg); }
  75%  { transform: rotateX(810deg)  rotateY(540deg)  rotateZ(270deg); }
  100% { transform: rotateX(1080deg) rotateY(720deg)  rotateZ(360deg); }
}

.dice-landed {
  animation: dice-land 0.8s ease-out forwards;
}
@keyframes dice-land {
  0%   { transform: rotateX(540deg) rotateY(360deg) scale(1.1); }
  60%  { transform: rotateX(0deg)   rotateY(0deg)   scale(0.95); }
  100% { transform: rotateX(-20deg) rotateY(30deg)  scale(1); }
}

.dice-result-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 24px 0;
}
.dice-result-face {
  font-size: 6rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px rgba(0, 250, 255, 0.8));
}
.dice-result-number {
  font-size: 2rem;
  font-weight: 800;
  color: #00faff;
  text-shadow: 0 0 12px rgba(0, 250, 255, 0.5);
}
.dice-result-effect {
  font-size: 1.1rem;
  color: #e0e6ee;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 250, 255, 0.3);
  border-radius: 8px;
  margin-top: 8px;
}

.dice-result-bounce {
  animation: dice-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes dice-bounce-in {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.3) rotate(10deg);  opacity: 1; }
  80%  { transform: scale(0.9) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* Turn Notification Popup */
.turn-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.turn-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.turn-popup-modal {
  background: rgba(20, 20, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 90%;
  width: 400px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 255, 255, 0.05);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.27);
}

.turn-popup-overlay.active .turn-popup-modal {
  transform: translateY(0) scale(1);
}

.turn-popup-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

.turn-popup-title {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
  background: linear-gradient(135deg, #fff 0%, #aaa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.turn-popup-desc {
  color: #ccc;
  font-size: 1.1rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.turn-popup-btn {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.1s, filter 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.turn-popup-btn:active {
  transform: scale(0.98);
}

.turn-popup-btn:hover {
  filter: brightness(1.1);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Modifiers for roles */
.turn-popup-modal--soc .turn-popup-title {
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.turn-popup-modal--apt .turn-popup-title {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.turn-popup-modal--apt .turn-popup-btn {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
/* =========================
   VFX & ANIMATIONS
   ========================= */

@keyframes cardEntry {
  from { transform: translateY(50px) rotate(5deg); opacity: 0; }
  to { transform: translateY(0) rotate(0deg); opacity: 1; }
}

.card-entry {
  animation: cardEntry 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes cardPlay {
  0% { transform: scale(1); filter: brightness(1) blur(0); }
  50% { transform: scale(1.1); filter: brightness(2) blur(2px); }
  100% { transform: scale(0.8); filter: brightness(0) blur(10px); opacity: 0; }
}

.card-playing {
  animation: cardPlay 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-4px, -2px); }
  20%, 40%, 60%, 80% { transform: translate(4px, 2px); }
}

.screen-shake {
  animation: screenShake 0.4s ease-in-out;
}

/* =========================
   DRAG & DROP STYLES
   ========================= */
.mini-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.mini-card[draggable="true"] {
  cursor: grab;
}

.mini-card[draggable="true"]:active {
  cursor: grabbing;
}

.mini-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.drop-zone {
  border: 2px dashed rgba(242, 140, 40, 0.3);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  margin: 12px 0;
  transition: all 0.2s;
  background: rgba(242, 140, 40, 0.05);
}

.drop-zone--active {
  border-color: #f28c28;
  background: rgba(242, 140, 40, 0.15);
  color: #fff;
  transform: scale(1.02);
  box-shadow: 0 0 20px rgba(242, 140, 40, 0.2);
}

.drop-zone-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}
/* ===================================================
   LOBBY ONBOARDING SYSTEM
   =================================================== */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin: 20px 0 40px;
    padding: 0 20px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #000;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #666;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.step-dot.active {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: scale(1.2);
    animation: neon-pulse-cyan 2s infinite;
}

.step-dot.completed {
    border-color: #39ff14;
    color: #39ff14;
    background: rgba(57, 255, 20, 0.1);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.3);
}

.step-label {
    position: absolute;
    top: 40px;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step-dot.active .step-label {
    opacity: 1;
    color: #00ffff;
}

/* SECTION HIGHLIGHTING */
.lobby-section {
    transition: all 0.4s ease;
    border: 1px solid transparent;
    margin-bottom: 10px;
}

.lobby-section.disabled {
    opacity: 0.15;
    pointer-events: none;
    filter: blur(1px) grayscale(1);
    transform: scale(0.98);
}

.lobby-section.active-focus {
    opacity: 1;
    transform: scale(1);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px;
    background: rgba(0, 255, 255, 0.03);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.05);
}

@keyframes neon-pulse-cyan {
    0% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.4); border-color: rgba(0, 255, 255, 0.4); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 255, 0.9); border-color: rgba(0, 255, 255, 1); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 255, 0.4); border-color: rgba(0, 255, 255, 0.4); }
}

.guide-hint {
    font-size: 0.8rem;
    color: #00ffff;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
    display: block;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 0.8; transform: translateY(0); }
}

/* MOBILE OPTIMIZATIONS (iPhone 16 / ~400px) */
@media (max-width: 480px) {
    .inner--lobby {
        padding: 15px 25px !important;
        padding-left: max(25px, env(safe-area-inset-left)) !important;
        padding-right: max(25px, env(safe-area-inset-right)) !important;
        display: flex;
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
    }

    .lobby-stepper {
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .step-label {
        font-size: 9px !important;
        letter-spacing: 1px;
    }

    .logo-container {
        margin-top: 0;
        margin-bottom: 5px;
        padding: 0;
    }

    .lobby-logo {
        max-width: 90px !important;
        height: auto;
    }

    .logo-container h1, 
    .logo-container p {
        display: none !important; /* Komplett ausblenden auf Mobile für maximalen Platz */
    }

    .section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .role-picker {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .role-card {
        padding: 10px 5px;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .role-card-icon {
        font-size: 1.1rem;
        margin-bottom: 2px;
    }

    .role-card-title {
        font-size: 0.75rem;
        line-height: 1.1;
    }

    .role-card-desc {
        display: none; /* Verstecke Beschreibung auf Mobile für mehr Platz */
    }

    .step-indicator {
        padding: 0 5px;
        margin: 10px 0 30px;
    }

    .step-indicator::before {
        left: 20px;
        right: 20px;
    }

    .step-dot {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .step-label {
        font-size: 0.5rem;
        top: 32px;
    }

    .lobby-input {
        font-size: 16px !important; /* iOS zoom fix: muss mind. 16px sein */
        padding: 10px !important;
    }

    .guide-hint {
        font-size: 0.7rem;
    }

    .lobby-section.active-focus {
        padding: 10px;
    }
}

/* =========================
   CARD DRAW OVERLAY
   ========================= */
.draw-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.draw-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.draw-overlay-content {
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.draw-overlay.active .draw-overlay-content {
  transform: scale(1);
}

.draw-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.draw-card-container {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
}

.draw-confirm-btn {
  background: linear-gradient(135deg, #00ffff, #008080);
  color: #000;
  border: none;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  transition: all 0.3s;
}

.draw-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.6);
}

.draw-overlay .card--full {
  margin: 0 auto;
  transform: none !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* =========================
   PHASE TRANSITION OVERLAY
   ========================= */
.phase-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000; /* Higher than draw-overlay (2000) */
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.phase-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.phase-overlay-content {
  text-align: center;
  max-width: 500px;
  width: 90%;
  padding: 40px;
  background: linear-gradient(135deg, rgba(20,20,20,0.95), rgba(0,0,0,0.98));
  border: 3px solid #f28c28;
  border-radius: 24px;
  box-shadow: 0 0 50px rgba(242, 140, 40, 0.4);
  transform: translateY(20px);
  transition: transform 0.5s ease;
}

.phase-overlay.active .phase-overlay-content {
  transform: translateY(0);
}

.phase-overlay-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: #f28c28;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 6px;
  text-shadow: 0 0 15px rgba(242, 140, 40, 0.6);
}

.phase-overlay-msg {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #fff;
  margin-bottom: 30px;
  white-space: pre-line;
}

.phase-overlay-hint {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 2px;
}
