/* Spielgefühl — Design System */

/* === Fonts === */

@font-face {
    font-family: 'Satoshi';
    src: url('/fonts/Satoshi-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi';
    src: url('/fonts/Satoshi-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
    font-style: normal;
}

@font-face {
    font-family: 'Satoshi';
    src: url('/fonts/Satoshi-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
    font-style: normal;
}

/* === Color System === */

:root {
    /* Background */
    --bg-primary: #1a1a2e;
    --bg-surface: #222240;
    --bg-elevated: #2a2a4a;

    /* Suit colors — bold, saturated, spades=green (Grün), clubs=blue */
    --suit-diamonds: #e8960a;
    --suit-hearts: #dc2842;
    --suit-spades: #18a848;
    --suit-clubs: #0898c0;

    /* Text */
    --text-primary: #e8e6e3;
    --text-secondary: #9896a3;
    --text-accent: #ffffff;

    /* UI */
    --ui-success: #4aab72;
    --ui-danger: #e05263;
    --ui-border: rgba(255, 255, 255, 0.08);

    /* Cards — scales with viewport height */
    --card-height: clamp(90px, 15vh, 200px);
    --card-ratio: 0.714; /* 2.5:3.5 */
    --card-bg: #f0ede8;
    --card-radius: var(--radius-md);
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* Opponent card sizing — same as player cards */
    --opp-card-height: var(--card-height);

    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;

    /* Typography */
    --fs-xs: 0.75rem;
    --fs-sm: 0.85rem;
    --fs-base: 1rem;
    --fs-md: 1.1rem;
    --fs-lg: 1.2rem;
    --fs-xl: 1.6rem;
    --fs-2xl: 2.2rem;
    --fs-display: 3rem;

    /* Motion — transitions */
    --transition-snap: 50ms ease-out;
    --transition-fast: 150ms ease-out;
    --transition-normal: 200ms ease-out;
    --transition-slow: 300ms ease;

    /* Motion — animation durations */
    --anim-quick: 350ms;
    --anim-pulse: 3s;
    --anim-drift: 4s;

    /* Aura gradients — friend (light/radiant), enemy (dark/shadowy) */
    --friend-gradient: linear-gradient(135deg, #1e1e3a 0%, #2e2e52 50%, #1e1e3a 100%);
    --enemy-gradient: linear-gradient(135deg, #050508 0%, #0e0e1a 50%, #050508 100%);

    /* Aura shadows — resting state (keyframe variants keep literals; CSS vars can't be animated) */
    --friend-shadow:
        0 0 25px rgba(255, 255, 255, 0.12),
        0 0 50px rgba(255, 255, 255, 0.06),
        inset 0 0 25px rgba(255, 255, 255, 0.05);
    --enemy-shadow:
        0 0 30px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 0 40px rgba(0, 0, 0, 0.6);
}

/* === Base === */

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

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

body {
    font-family: 'Satoshi', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */

#skat-app {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "info"
        "center"
        "hand";
    padding: var(--space-xl) var(--space-2xl) 0;
    gap: var(--space-sm);
    max-width: 1600px;
    margin: 0 auto;
    position: relative;
}

.info-bar {
    grid-area: info;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--fs-md);
    font-weight: 500;
    color: var(--text-primary);
    min-height: 36px;
}


.center-area {
    grid-area: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-md);
    z-index: 2;
    position: relative;
}

.hand-area {
    grid-area: hand;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    /* 16vh raises the hand off the bottom edge, leaving room for card hover lift */
    margin-bottom: 16vh;
    position: relative;
    z-index: 2;
}

/* Base hand layout */
.hand-area .hand {
    border-radius: var(--radius-lg);
    padding: var(--space-sm) var(--space-md);
    position: relative;
}

/* Player hand — friend (light/radiant) aura matching the friendly opponent area */
.hand-area.is-friend .hand {
    background: var(--friend-gradient);
    box-shadow: var(--friend-shadow);
    animation: friendPulse var(--anim-pulse) ease-in-out infinite;
}

.hand-area.is-friend .hand::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: friendGlow var(--anim-drift) ease-in-out infinite;
}

/* === Opponents === */

.opponent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: box-shadow var(--transition-slow);
}

/* Opponents form an inverted V — fans stretch from screen edges to top-center */

.opponent-left {
    position: absolute;
    left: 8%;   /* distance from screen edge; tighter = more central V */
    top: 42%;   /* vertical midpoint of center-area for consistent V apex */
    transform: translateY(-50%) rotate(-60deg); /* 60° tilt creates the inverted-V fan angle */
    transform-origin: left center;
    z-index: 1;
}

.opponent-right {
    position: absolute;
    right: 8%;  /* mirrors .opponent-left */
    top: 42%;   /* mirrors .opponent-left */
    transform: translateY(-50%) rotate(60deg);  /* mirrors .opponent-left, positive angle */
    transform-origin: right center;
    z-index: 1;
}

/* Enemy: dark, shadowy, menacing — animated dark mist */
.opponent.is-enemy {
    background: var(--enemy-gradient);
    box-shadow: var(--enemy-shadow);
    color: var(--text-primary);
    animation: enemyPulse var(--anim-pulse) ease-in-out infinite;
}

@keyframes enemyPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(0,0,0,0.8), 0 0 60px rgba(0,0,0,0.5), inset 0 0 40px rgba(0,0,0,0.6); }
    50% { box-shadow: 0 0 40px rgba(0,0,0,0.9), 0 0 80px rgba(0,0,0,0.6), inset 0 0 50px rgba(0,0,0,0.7); }
}

.opponent.is-enemy::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 20px;
    background: radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    animation: enemyMist var(--anim-drift) ease-in-out infinite;
}

@keyframes enemyMist {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.04); }
}

/* Friend: bright, radiant, glowing — animated light pulse */
.opponent.is-friend {
    background: var(--friend-gradient);
    box-shadow: var(--friend-shadow);
    color: var(--text-accent);
    animation: friendPulse var(--anim-pulse) ease-in-out infinite;
}

@keyframes friendPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(255,255,255,0.12), 0 0 50px rgba(255,255,255,0.06), inset 0 0 25px rgba(255,255,255,0.05); }
    50% { box-shadow: 0 0 35px rgba(255,255,255,0.18), 0 0 70px rgba(255,255,255,0.09), inset 0 0 30px rgba(255,255,255,0.08); }
}

.opponent.is-friend::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 20px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: friendGlow var(--anim-drift) ease-in-out infinite;
}

@keyframes friendGlow {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

.opponent .opp-hand {
    display: flex;
    justify-content: center;
}

.opponent .opp-hand .card {
    height: var(--opp-card-height);
    width: calc(var(--opp-card-height) * var(--card-ratio));
    /* -0.52 overlap coefficient: ~half a card width overlap for a tight face-down fan */
    margin-left: calc(var(--opp-card-height) * -0.52);
}

.opponent .opp-hand .card:first-child {
    margin-left: 0;
}

/* === Previous trick (small, top center overlay) === */

.prev-trick {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.4;
    transition: opacity var(--transition-fast);
    z-index: 5;
}

.prev-trick:hover {
    opacity: 0.9;
}

.prev-trick .trick-area {
    width: 250px;
    height: 180px;
    position: relative;
}

/* Override trick slot and card sizing inside prev-trick */
.prev-trick .trick-slot {
    width: calc(120px * var(--card-ratio));
    height: 120px;
}


/* === Trick slot alliance indicators — animated dark/light aura === */

.trick-slot.is-enemy-card {
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 20%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    box-shadow: 0 0 30px 8px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.6);
    animation: enemySlotPulse var(--anim-pulse) ease-in-out infinite;
}

@keyframes enemySlotPulse {
    0%, 100% { box-shadow: 0 0 30px 8px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,0,0,0.5); }
    50% { box-shadow: 0 0 40px 12px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.6); }
}

.trick-slot.is-enemy-card .card {
    box-shadow: var(--card-shadow);
}

.trick-slot.is-friend-card {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.25) 20%, rgba(255, 255, 255, 0.12) 60%, transparent 100%);
    box-shadow: 0 0 30px 8px rgba(255, 255, 255, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    animation: friendSlotPulse var(--anim-pulse) ease-in-out infinite;
}

@keyframes friendSlotPulse {
    0%, 100% { box-shadow: 0 0 30px 8px rgba(255,255,255,0.15), inset 0 0 20px rgba(255,255,255,0.1); }
    50% { box-shadow: 0 0 40px 12px rgba(255,255,255,0.22), inset 0 0 25px rgba(255,255,255,0.14); }
}

.trick-slot.is-friend-card .card {
    box-shadow: var(--card-shadow);
}

.trick-slot-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.trick-slot-icon svg * {
    stroke: currentColor;
    fill: none;
}

.trick-slot-icon .icon-filled {
    fill: currentColor;
    stroke: none;
}

/* Counter-rotate icons inside the ±120° rotated opponent slots so they appear upright. */
.trick-slot-left .trick-slot-icon {
    transform: translate(-50%, -50%) rotate(-120deg);
}
.trick-slot-right .trick-slot-icon {
    transform: translate(-50%, -50%) rotate(120deg);
}

/* Game type watermark in the triangle center — visible during trick play only */
.trick-type-indicator {
    position: absolute;
    left: 50%;
    top: 55%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--text-secondary);
}

/* === Trump sparkle effect === */
/* Sparkle particles are added via JS as sibling elements outside the card */

.trump-sparkle {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    color: #ffffff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 12px rgba(255, 255, 255, 0.4);
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.2; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.4); }
}

.card.trump {
    box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.12);
}

/* === Card Component === */

.card {
    width: calc(var(--card-height) * var(--card-ratio));
    height: var(--card-height);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    flex-shrink: 0;
    position: relative;
    cursor: default;
}

.card svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Card interactive states --- */

.hand .card:hover {
    transform: translateY(-12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.hand .card:focus-visible {
    transform: translateY(-12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 100;
}

.card.legal {
    cursor: pointer;
}

.card.illegal {
    opacity: 0.35;
    pointer-events: none;
}

.card:active {
    transform: scale(0.95) !important;
    transition: transform var(--transition-snap);
}

.card.selected {
    transform: translateY(-16px);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

.card.selected:hover {
    transform: translateY(-18px);
    box-shadow: 0 0 22px rgba(255, 215, 0, 0.8);
}

/* --- Trump card accent — wider left stripe --- */

.card.trump svg rect:nth-child(2) {
    width: 8 !important;
}

/* === Hand === */

.hand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand .card {
    margin-left: -32px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hand .card:first-child {
    margin-left: 0;
}

/* === Trick Area === */

.trick-area {
    position: relative;
    width: 100%;
    height: calc(var(--card-height) * 3.5);
}

.trick-slot {
    /* 1.15× card size: slight oversize gives breathing room and improves drop target hit area */
    width: calc(var(--card-height) * 1.15 * var(--card-ratio));
    height: calc(var(--card-height) * 1.15);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--card-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.trick-slot .card {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Triangular trick slot positions — each slot in front of its player's fan center.
   Percentages are relative to .trick-area container.
   Opponent fans are at ~6% (left) and ~94% (right) of container width,
   centered at ~32% height. Slots offset ~10% toward center with gap. */
.trick-slot-left {
    position: absolute;
    left: 40%;
    top: 42%;
    transform: translate(-50%, -50%) rotate(120deg);
}
.trick-slot-right {
    position: absolute;
    left: 60%;
    top: 42%;
    transform: translate(-50%, -50%) rotate(-120deg);
}
.trick-slot-human {
    position: absolute;
    left: 50%;
    top: 81%;
    transform: translate(-50%, -50%);
}

/* === Action Prompts === */

.prompt {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.prompt-text {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-accent);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Bidding value — large and dramatic */
.bid-value {
    font-size: var(--fs-display);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-accent);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
    animation: bid-pulse 1.5s ease-in-out infinite;
}

@keyframes bid-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.prompt-actions {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    justify-content: center;
}

/* === Buttons === */

.btn {
    font-family: 'Satoshi', system-ui, sans-serif;
    font-size: var(--fs-md);
    font-weight: 600;
    padding: var(--space-lg) var(--space-2xl);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    color: #fff;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: scale(0.97);
}

.btn:focus-visible {
    outline: 2px solid var(--text-accent);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: var(--ui-success);
}

.btn-danger {
    background: var(--ui-danger);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.btn-suit-diamonds { background: var(--suit-diamonds); }
.btn-suit-hearts { background: var(--suit-hearts); }
.btn-suit-spades { background: var(--suit-spades); }
.btn-suit-clubs { background: var(--suit-clubs); }
.btn-suit-grand { background: #6366f1; }
.btn-suit-null { background: var(--bg-elevated); color: var(--text-secondary); }

.btn-small {
    font-size: var(--fs-sm);
    padding: var(--space-sm) var(--space-lg);
}

/* === Result === */

.result {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.result-title {
    font-size: var(--fs-2xl);
    font-weight: 700;
}

.result-title.won {
    color: var(--ui-success);
    text-shadow: 0 0 30px rgba(74, 171, 114, 0.3);
}

.result-title.lost {
    color: var(--ui-danger);
    text-shadow: 0 0 30px rgba(224, 82, 99, 0.3);
}

.result-details {
    font-size: var(--fs-md);
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.result-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    background: var(--bg-elevated);
    color: var(--text-primary);
    margin: 2px;
}

/* === Score table === */

.score-table {
    margin: var(--space-lg) auto;
    min-width: 200px;
    max-width: 320px;
    font-variant-numeric: tabular-nums;
}

.score-row {
    display: flex;
    gap: var(--space-xs);
}

.score-cell {
    flex: 1;
    text-align: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.score-header .score-cell {
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-icon {
    width: 24px !important;
    height: 34px !important;
    border-radius: var(--radius-sm);
}

.score-totals .score-cell {
    font-weight: 700;
    font-size: var(--fs-base);
    color: var(--text-primary);
    padding-top: var(--space-sm);
    border-top: 2px solid var(--bg-elevated);
}

.score-positive { color: #4ade80; }
.score-negative { color: #f87171; }
.score-zero { color: var(--text-secondary); opacity: 0.4; }

/* === Welcome === */

.welcome {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xl);
}

.welcome-title {
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--text-accent);
}

/* === Settings Screen === */

.settings-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    gap: var(--space-xl);
}

.settings-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--text-primary);
}

.difficulty-cards {
    display: flex;
    gap: var(--space-lg);
}

.difficulty-card {
    width: clamp(120px, 15vw, 160px);
    padding: clamp(20px, 3vh, 32px) clamp(12px, 2vw, 20px);
    border-radius: var(--radius-lg);
    background: #2a2a3a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.difficulty-card.selected {
    background: #3a3a5a;
    border-color: var(--accent, #5a7aff);
    box-shadow: 0 0 16px rgba(90, 122, 255, 0.3);
}

.difficulty-card:hover:not(.selected) {
    background: #333348;
}

.difficulty-icon {
    font-size: clamp(24px, 4vw, 36px);
    color: var(--text-secondary);
}

.difficulty-label {
    font-size: clamp(14px, 2vw, 17px);
    font-weight: 600;
    color: var(--text-primary);
}

.difficulty-desc {
    font-size: clamp(10px, 1.5vw, 12px);
    color: var(--text-secondary);
    text-align: center;
}

.hints-toggle-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.hints-toggle {
    width: 40px;
    height: 22px;
    border-radius: var(--radius-lg);
    background: #555;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-normal);
}

.hints-toggle.active {
    background: var(--accent, #5a7aff);
}

.hints-toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-normal);
}

.hints-toggle.active .hints-toggle-knob {
    transform: translateX(18px);
}

.hints-label {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.play-button {
    padding: clamp(12px, 2vh, 16px) clamp(36px, 6vw, 56px);
    border-radius: var(--radius-lg);
    background: var(--accent, #5a7aff);
    color: white;
    font-size: clamp(16px, 2.5vw, 19px);
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.play-button:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(90, 122, 255, 0.4);
}

.play-button:active {
    transform: scale(0.97);
}

/* === Responsive (landscape phone to desktop) === */

@media (max-width: 900px) {
    #skat-app {
        padding: var(--space-md) var(--space-lg);
        gap: var(--space-xs) var(--space-sm);
    }

    .hand .card {
        margin-left: -28px;
    }

    .prompt-text {
        font-size: var(--fs-base);
    }

    .btn {
        font-size: var(--fs-sm);
        padding: var(--space-sm) var(--space-lg);
    }
}

@media (max-width: 700px) {
    .hand .card {
        margin-left: -24px;
    }

    .info-bar {
        font-size: var(--fs-xs);
    }

    #skat-app {
        padding: var(--space-sm) var(--space-md);
    }
}

.hint-float {
    animation: hintWiggle 0.8s ease-in-out infinite;
}

@keyframes hintWiggle {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    20% {
        transform: rotate(-3deg) scale(1.04);
    }
    40% {
        transform: rotate(3deg) scale(1.04);
    }
    60% {
        transform: rotate(-2deg) scale(1.03);
    }
    80% {
        transform: rotate(2deg) scale(1.03);
    }
}

/* --- Bid replay animations --- */

.bid-dimmed {
    opacity: 0.25;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.bid-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.bid-number {
    position: absolute;
    font-family: 'Satoshi', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    will-change: transform, opacity;
}

.bid-accept-icon {
    position: absolute;
    font-size: 4rem;
    font-weight: 700;
    color: #4ade80;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.7), 0 0 40px rgba(74, 222, 128, 0.3);
    will-change: transform, opacity;
}

.bid-reject-icon {
    position: absolute;
    font-size: 4rem;
    font-weight: 700;
    color: #f87171;
    text-shadow: 0 0 20px rgba(248, 113, 113, 0.7), 0 0 40px rgba(248, 113, 113, 0.3);
    will-change: transform, opacity;
}

/* --- Role icons (heritage iconography) --- */

.role-icon {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

/* Persistent role icons at fixed screen positions (appended to app, not inside player areas) */
.role-icon-slot {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.role-icon-slot.icon-top-left {
    top: 15%;
    left: 5%;
}

.role-icon-slot.icon-top-right {
    top: 15%;
    right: 5%;
}

.role-icon-slot.icon-bottom {
    /* 16vh matches .hand-area margin-bottom; -120px offsets the icon above the hand */
    bottom: calc(16vh - 120px);
    left: 50%;
    transform: translateX(-50%);
}

.role-icon svg * {
    stroke: currentColor;
    fill: none;
}

.role-icon .icon-filled {
    fill: currentColor;
    stroke: none;
}

.role-icon.neutral {
    color: #e0e0e0;
}

.role-icon.friend {
    color: #e0e0e0;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4));
    animation: iconFriendPulse var(--anim-pulse) ease-in-out infinite;
}

.role-icon.enemy {
    color: #777;
    opacity: 0.5;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.6));
    animation: iconEnemyPulse var(--anim-pulse) ease-in-out infinite;
}

@keyframes iconFriendPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.6)); }
}

@keyframes iconEnemyPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.6; }
}

@keyframes iconPulseReveal {
    0% { filter: brightness(1); }
    40% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

.role-icon.pulse-reveal {
    animation: iconPulseReveal var(--anim-quick) ease-out forwards;
}

/* === Bidding Stage === */

.bidding-stage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    z-index: 3;
    pointer-events: none;
}

.bidding-stage .role-icon {
    position: relative;
}

.bid-prompt-player {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
