/* ============================================================
   STYLE_GUIDE.md — Secció 3: Variables CSS obligatòries
   ============================================================ */
:root {
    --bg:       #ffffff;
    --surface:  #f8f9fa;
    --surface2: #f1f3f5;
    --border:   #e5e5e5;
    --border2:  #d4d4d4;
    --text:     #0f172a;
    --body:     #3f3f46;
    --muted:    #71717a;
    --accent:   #c8102e;
    --accent-hover: #a00d24;
    --accent-soft:  #fef2f2;
    --accent2:  #0284c7;
    --green:    #16a34a;
    --amber:    #d97706;
    --red:      #dc2626;
    --r:        8px;
    --r-sm:     4px;

    --font-serif: 'Lora', Georgia, serif;
    --font-sans:  'Inter', system-ui, sans-serif;
    --font-mono:  'IBM Plex Mono', monospace;
}

/* ============================================================
   Reset & Base
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100vh;
    height: 100dvh;
}

body {
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    background: var(--bg);
    color: var(--body);
    font-family: var(--font-sans);
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    color: var(--text);
}

h2 {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
}

h3 {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

p {
    font-size: 15px;
    font-weight: 400;
    color: var(--body);
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

em {
    font-style: italic;
    color: var(--accent);
}

/* ============================================================
   Reusable Components
   ============================================================ */

.section-label {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 600;
}

.callout {
    border-left: 2px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--accent-soft);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.callout p {
    color: var(--text);
    font-size: 15px;
    margin: 0;
}

.formula {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.25rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text);
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 2;
}
.formula .hl  { color: var(--accent); font-weight: 500; }
.formula .hl2 { color: var(--accent2); }

.quote {
    padding: 2rem 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    color: var(--muted);
    line-height: 1.5;
    text-align: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 2rem 0;
}
.quote cite {
    display: block;
    font-size: 13px;
    font-style: normal;
    font-family: var(--font-sans);
    color: var(--muted);
    margin-top: 0.75rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 1.25rem 1.5rem;
    transition: border-color .2s, box-shadow .2s;
}
.card:hover {
    border-color: var(--border2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.chip {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    font-family: var(--font-mono);
}
.chip-in  { background: rgba(22,163,74,0.1);   color: #15803d; border: 1px solid rgba(22,163,74,0.2); }
.chip-out { background: rgba(220,38,38,0.08);  color: #dc2626; border: 1px solid rgba(220,38,38,0.18); }
.chip-mb  { background: rgba(217,119,6,0.08);  color: #d97706; border: 1px solid rgba(217,119,6,0.18); }

/* ============================================================
   Layout
   ============================================================ */
.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

/* ============================================================
   App Container
   ============================================================ */
#app {
    width: 100%;
    max-width: 500px;
    height: 100%;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* ============================================================
   Screens
   ============================================================ */
.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transition: opacity 0.4s ease;
}

.screen.hidden {
    display: none;
    opacity: 0;
}

.screen.active {
    opacity: 1;
}

.bg-blobs {
    display: none;
}

/* ============================================================
   Bars container — sticky nav style
   ============================================================ */
.bars-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: calc(15px + env(safe-area-inset-top)) 10px 10px;
    background: rgba(255,255,255,0.92);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 22%;
    transition: transform 0.3s;
}

.bar-item.shake {
    animation: barShake 0.5s ease;
}

@keyframes barShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-4px); }
    40%      { transform: translateX(4px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(3px); }
}

.bar-icon {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: var(--muted);
}

.bar-track {
    width: 100%;
    height: 6px;
    background: #f1f3f5;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.4s;
    background: var(--green);
}

.bar-fill.warn {
    background: var(--amber);
}

.bar-fill.danger {
    background: var(--red);
}

.bar-label {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-sans);
}

/* ============================================================
   Intro Screens
   ============================================================ */
.intro-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 25px 30px;
    text-align: center;
    overflow-y: auto;
    min-height: 0;
}

.intro-icon svg {
    width: 100px;
    height: 100px;
    margin: 15px 0 20px;
}

.intro-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.intro-sub {
    font-size: 0.9rem;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.intro-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 420px;
    margin-bottom: 20px;
    color: var(--body);
}

.intro-forces-list {
    list-style: none;
    padding: 0;
    margin: 0 auto 30px auto;
    width: 100%;
    max-width: 440px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.intro-forces-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 10px;
    border-radius: var(--r);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.intro-forces-list li:hover {
    background: var(--surface2);
    transform: translateY(-2px);
    border-color: var(--border2);
}

.intro-forces-list li svg {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.force-text strong {
    font-family: var(--font-serif);
    color: var(--text);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}

.force-text span {
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.2;
    display: block;
}

.intro-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 0.85rem;
    color: var(--muted);
}

.btn-start {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 16px 40px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s, transform 0.2s;
    width: 100%;
    max-width: 300px;
}

.btn-start:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* ============================================================
   Game Screen
   ============================================================ */
.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(80px + env(safe-area-inset-top)) 20px 20px;
    position: relative;
    overflow-y: auto;
    min-height: 0;
}

.turn-counter {
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 10px 0 12px;
    flex-shrink: 0;
}

/* Game card — extends the .card component */
#card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 25px 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.card-character {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
    min-height: 110px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    max-width: 380px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 10px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 80px;
    backdrop-filter: blur(5px);
}

.action-btn.left {
    border-bottom: 3px solid var(--red);
}

.action-btn.right {
    border-bottom: 3px solid var(--green);
}

.action-btn:hover,
.action-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.action-btn.left:hover,
.action-btn.left:active {
    background: rgba(220,38,38,0.08);
    border-color: var(--red);
}

.action-btn.right:hover,
.action-btn.right:active {
    background: rgba(22,163,74,0.08);
    border-color: var(--green);
}

/* Previewing state for mobile double-tap */
.action-btn.previewing {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.action-btn.left.previewing {
    background: rgba(220,38,38,0.1);
    border-color: var(--red);
    box-shadow: 0 5px 20px rgba(220,38,38,0.2);
}

.action-btn.right.previewing {
    background: rgba(22,163,74,0.1);
    border-color: var(--green);
    box-shadow: 0 5px 20px rgba(22,163,74,0.2);
}

.btn-arrow {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 8px;
    color: var(--muted);
    transition: color 0.2s;
}

.action-btn.left:hover .btn-arrow,
.action-btn.left:active .btn-arrow,
.action-btn.left.previewing .btn-arrow {
    color: var(--red);
}

.action-btn.right:hover .btn-arrow,
.action-btn.right:active .btn-arrow,
.action-btn.right.previewing .btn-arrow {
    color: var(--green);
}

/* Impact preview dots */
.impact-preview {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 10px 0 20px;
    min-height: 50px;
    flex-shrink: 0;
}

.mobile-hint {
    text-align: center;
    font-size: 0.7rem;
    color: var(--muted);
    padding: 0 20px 10px;
    opacity: 0;
    transition: opacity 0.3s;
    display: none;
    line-height: 1.3;
}

.mobile-hint.visible {
    opacity: 0.8;
}

.impact-dot {
    font-size: 1.3rem;
    opacity: 0.3;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--muted);
}

.impact-dot.up {
    opacity: 1;
    transform: scale(1.5);
    color: var(--green);
    filter: drop-shadow(0 0 10px rgba(22,163,74,0.4));
}

.impact-dot.down {
    opacity: 1;
    transform: scale(1.5);
    color: var(--red);
    filter: drop-shadow(0 0 10px rgba(220,38,38,0.4));
}

/* ============================================================
   End Screen
   ============================================================ */
.end-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 25px 35px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 0;
}

.end-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 25px;
}

.end-headline {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 20px 15px;
    border-radius: var(--r);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
    margin-bottom: 25px;
    line-height: 1.3;
    max-width: 450px;
}

.end-reason {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.5;
    max-width: 400px;
    margin: 0 auto 35px;
}

.end-stats {
    margin-bottom: 35px;
    text-align: left;
    width: 100%;
    max-width: 420px;
}

.end-stats h3 {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
    text-align: center;
}

.end-bar-row {
    margin-bottom: 15px;
}

.end-bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.end-bar-track {
    height: 8px;
    background: #f1f3f5;
    border-radius: 4px;
    overflow: hidden;
}

.end-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.end-decisions {
    margin-bottom: 30px;
    text-align: left;
}

.end-decisions h3 {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
}

.end-decisions ul {
    list-style: none;
    padding: 0;
}

.end-decisions li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 15px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text);
}

.end-decisions li .dir {
    font-weight: 700;
    margin-right: 4px;
}

.end-decisions li .dir.left {
    color: var(--red);
}

.end-decisions li .dir.right {
    color: var(--green);
}

.btn-survey {
    display: block;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 16px 20px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 18px;
    transition: background 0.2s, transform 0.2s;
    width: 100%;
    max-width: 380px;
}

.btn-survey:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-restart {
    display: block;
    margin: 0 auto;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 14px 35px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    max-width: 280px;
}

.btn-restart:hover {
    background: var(--surface);
    border-color: var(--border2);
}

.end-thanks {
    display: block;
    background: var(--accent);
    color: #fff;
    padding: 18px 24px;
    border-radius: var(--r-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    margin-top: 6px;
    width: 100%;
    max-width: 380px;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#card {
    animation: fadeIn 0.35s ease forwards;
}

/* ============================================================
   STYLE_GUIDE.md — Secció 9: Responsivitat mínima obligatòria
   ============================================================ */
@media (max-width: 560px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    h2 {
        font-size: 24px;
    }

    .intro-content h1 {
        font-size: clamp(24px, 5vw, 36px);
    }
}

/* Tablets and small laptops */
@media (max-width: 768px) {
    .intro-icon svg {
        width: 90px;
        height: 90px;
    }

    .card-text {
        font-size: 1rem;
        min-height: 100px;
    }
}

/* Large phones */
@media (max-width: 480px) {
    .intro-content {
        padding: 30px 20px 25px;
    }

    .intro-icon svg {
        width: 80px;
        height: 80px;
        margin: 10px 0 15px;
    }

    .intro-content h1 {
        font-size: clamp(22px, 4.5vw, 32px);
        margin-bottom: 15px;
    }

    .intro-desc {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .intro-forces-list {
        gap: 10px;
        margin-bottom: 25px;
    }

    .intro-forces-list li {
        padding: 10px 8px;
    }

    .force-text strong {
        font-size: 0.85rem;
    }

    .force-text span {
        font-size: 0.65rem;
    }

    .btn-start {
        padding: 16px 30px;
        font-size: 1rem;
    }

    .bars-container {
        padding: calc(12px + env(safe-area-inset-top)) 8px 8px;
    }

    .bar-icon {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }

    .bar-track {
        height: 5px;
    }

    .bar-label {
        font-size: 0.6rem;
    }

    .game-area {
        padding: calc(75px + env(safe-area-inset-top)) 15px 15px;
    }

    .turn-counter {
        font-size: 0.75rem;
        margin: 8px 0 10px;
    }

    #card {
        padding: 20px 20px;
        max-width: 100%;
    }

    .card-character {
        font-size: 0.85rem;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .card-text {
        font-size: 0.95rem;
        min-height: 90px;
    }

    .action-buttons {
        max-width: 100%;
        gap: 12px;
    }

    .action-btn {
        font-size: 0.85rem;
        padding: 10px 8px;
        min-height: 75px;
    }

    .btn-arrow {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .impact-preview {
        gap: 20px;
        padding: 8px 0 15px;
    }

    .impact-dot {
        font-size: 1.2rem;
    }

    .mobile-hint {
        font-size: 0.65rem;
        padding: 0 15px 8px;
    }

    .end-content {
        padding: 25px 20px 30px;
    }

    .end-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .end-headline {
        font-size: 1.2rem;
        padding: 18px 12px;
    }

    .end-reason {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .intro-content {
        padding: 25px 15px 20px;
    }

    .intro-icon svg {
        width: 70px;
        height: 70px;
        margin: 8px 0 12px;
    }

    .intro-content h1 {
        font-size: clamp(20px, 4vw, 28px);
        letter-spacing: 1.5px;
        margin-bottom: 12px;
    }

    .intro-desc {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .intro-forces-list {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-bottom: 20px;
    }

    .intro-forces-list li {
        flex-direction: row;
        text-align: left;
        padding: 10px 12px;
        gap: 10px;
    }

    .intro-forces-list li svg {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .force-text strong {
        font-size: 0.8rem;
    }

    .force-text span {
        font-size: 0.65rem;
    }

    .btn-start {
        padding: 15px 20px;
        width: 100%;
        font-size: 0.95rem;
    }

    .bars-container {
        padding: calc(10px + env(safe-area-inset-top)) 5px 8px;
    }

    .bar-item {
        width: 23%;
    }

    .bar-icon {
        font-size: 1.1rem;
    }

    .bar-icon svg {
        width: 18px;
        height: 18px;
    }

    .bar-track {
        height: 4px;
    }

    .bar-label {
        font-size: 0.55rem;
    }

    .game-area {
        padding: calc(70px + env(safe-area-inset-top)) 12px 12px;
    }

    #card {
        padding: 18px 18px;
        border-radius: var(--r-sm);
    }

    .card-character {
        font-size: 0.8rem;
        letter-spacing: 1.5px;
    }

    .card-text {
        font-size: 0.9rem;
        line-height: 1.5;
        min-height: 80px;
    }

    .action-buttons {
        gap: 10px;
    }

    .action-btn {
        font-size: 0.8rem;
        padding: 10px 5px;
        min-height: 70px;
        border-radius: var(--r-sm);
    }

    .btn-arrow {
        font-size: 1.3rem;
    }

    .impact-preview {
        gap: 18px;
        padding: 6px 0 12px;
    }

    .impact-dot {
        font-size: 1.1rem;
    }

    .mobile-hint {
        font-size: 0.6rem;
        padding: 0 12px 6px;
    }

    .end-content {
        padding: 20px 15px 25px;
    }

    .end-title {
        font-size: 1.6rem;
    }

    .end-headline {
        font-size: 1.1rem;
        padding: 15px 10px;
    }

    .end-reason {
        font-size: 0.85rem;
    }

    .end-stats h3,
    .end-decisions h3 {
        font-size: 0.8rem;
    }

    .end-decisions li {
        font-size: 0.8rem;
        padding: 10px 12px;
    }

    .btn-survey {
        font-size: 0.9rem;
        padding: 14px 18px;
    }

    .btn-restart {
        font-size: 0.85rem;
        padding: 12px 25px;
    }
}

/* Extra small phones and landscape orientation tweaks */
@media (max-width: 340px) {
    .intro-content h1 {
        font-size: 1.1rem;
        letter-spacing: 1px;
    }

    .intro-desc {
        font-size: 0.8rem;
    }

    .card-text {
        font-size: 0.85rem;
        min-height: 70px;
    }

    .action-btn {
        font-size: 0.75rem;
        min-height: 65px;
    }

    .btn-arrow {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
}

/* Very short mobile screens in portrait */
@media (max-height: 700px) and (orientation: portrait) {
    .intro-content {
        padding: 20px 20px 20px;
    }

    .intro-icon svg {
        width: 70px;
        height: 70px;
        margin: 8px 0 12px;
    }

    .intro-content h1 {
        font-size: clamp(18px, 4vw, 26px);
        margin-bottom: 12px;
    }

    .intro-desc {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }

    .intro-forces-list {
        margin-bottom: 15px;
        gap: 8px;
    }

    .btn-start {
        padding: 14px 25px;
        font-size: 0.95rem;
    }

    .game-area {
        padding: calc(70px + env(safe-area-inset-top)) 15px 12px;
    }

    .turn-counter {
        margin: 6px 0 8px;
    }

    #card {
        padding: 18px 20px;
        margin-bottom: 12px;
    }

    .card-text {
        font-size: 0.9rem;
        min-height: 70px;
    }

    .action-btn {
        min-height: 65px;
        padding: 8px 8px;
        font-size: 0.8rem;
    }

    .end-content {
        padding: 20px 20px 25px;
    }

    .end-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .end-headline {
        font-size: 1.1rem;
        padding: 15px 12px;
        margin-bottom: 15px;
    }
}

/* Landscape mode optimization for phones */
@media (max-height: 600px) and (orientation: landscape) {
    .intro-content {
        padding: 15px 20px 15px;
    }

    .intro-icon svg {
        width: 60px;
        height: 60px;
        margin: 5px 0 8px;
    }

    .intro-content h1 {
        font-size: clamp(16px, 3.5vw, 24px);
        margin-bottom: 10px;
    }

    .intro-desc {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }

    .intro-forces-list {
        margin-bottom: 15px;
        gap: 8px;
    }

    .btn-start {
        padding: 12px 25px;
        font-size: 0.9rem;
    }

    .game-area {
        padding: calc(65px + env(safe-area-inset-top)) 15px 12px;
    }

    #card {
        padding: 15px 20px;
    }

    .card-text {
        font-size: 0.9rem;
        min-height: 60px;
    }

    .action-btn {
        min-height: 60px;
        padding: 8px 10px;
    }

    .impact-preview {
        padding: 6px 0 10px;
    }
}

/* ============================================================
   Touch-Friendly Enhancements
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
    .mobile-hint {
        display: block;
    }

    .btn-start,
    .action-btn,
    .btn-survey,
    .btn-restart {
        min-height: 44px;
        touch-action: manipulation;
    }

    .btn-start:active {
        transform: scale(0.97);
        background: var(--accent-hover);
    }

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

    .action-btn.left:active {
        background: rgba(220,38,38,0.1);
    }

    .action-btn.right:active {
        background: rgba(22,163,74,0.1);
    }

    .btn-survey:active {
        transform: scale(0.97);
        background: var(--accent-hover);
    }

    .btn-restart:active {
        background: var(--surface);
        transform: scale(0.97);
    }

    .intro-forces-list li:active {
        background: var(--surface2);
        transform: scale(0.98);
    }

    .btn-start,
    .action-btn,
    .btn-survey,
    .btn-restart,
    .intro-forces-list li {
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .intro-content,
    .game-area,
    .end-content {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}
