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

body {
    font-family: 'Lilita One', cursive;
    background: #1e0340;
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 40%, #7c3aed 0%, #5b21b6 30%, #3b0764 65%, #1e0340 100%);
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 250vmax;
    height: 250vmax;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.03) 0deg 5deg, transparent 5deg 10deg);
    animation: bg-spin 240s linear infinite;
    z-index: 0;
    pointer-events: none;
}
@keyframes bg-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body::after { animation: none; } }

#startScreen,
#gameArea,
#resultScreen,
#endScreen {
    position: relative;
    z-index: 1;
}

.hidden { display: none !important; }

#startScreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
}

.cg-start-inner {
    text-align: center;
    padding: 24px;
}

.cg-start-logo {
    height: 48px;
    width: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 16px rgba(168,85,247,0.6));
}

.cg-mode-name {
    font-size: clamp(2rem, 6vw, 3rem);
    background: linear-gradient(135deg, #c084fc, #a855f7, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    text-shadow: none;
}

.cg-mode-desc {
    font-family: system-ui, sans-serif;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    color: rgba(255,255,255,0.7);
    margin-bottom: 36px;
    line-height: 1.5;
}

.countdown-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cg-mode-badge {
    font-family: 'Lilita One', cursive;
    font-size: 0.85rem;
    color: #a855f7;
    border: 1px solid rgba(167,139,250,0.4);
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(168,85,247,0.1);
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.countdown-number {
    font-size: 120px;
    font-weight: 700;
    background: linear-gradient(135deg, #c084fc, #a855f7, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(168,85,247,0.6));
    animation: 1s infinite alternate pulse;
    font-family: 'Lilita One', cursive;
}

.countdown-text {
    font-size: 22px;
    font-weight: 500;
    margin-top: 20px;
    letter-spacing: 2px;
    color: #c4b5fd;
    text-shadow: 0 0 12px rgba(168,85,247,0.4);
    font-family: 'Lilita One', cursive;
}

@keyframes pulse {
    0%   { transform: scale(.95); opacity: .7; }
    100% { transform: scale(1.05); opacity: 1; }
}

#quitBtn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 50;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 8px 14px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
#quitBtn:hover { background: rgba(0,0,0,0.7); }
#quitBtn img {
    height: 1.2rem;
    width: auto;
    vertical-align: middle;
    display: block;
}

#gameArea {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 210px 32px 90px;
    overflow: visible;
}

#timer-circle-container {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30,10,60,0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(167,139,250,0.35);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(124,58,237,0.4), 0 4px 16px rgba(0,0,0,0.5);
}
#timer-circle-container.hidden { display: none !important; }

#timer-svg {
    position: absolute;
    top: 0;
    left: 0;
}

#timer-bg { opacity: .7; }

#timer-progress-circle {
    transition: stroke-dashoffset 1s linear;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    filter: drop-shadow(0 0 6px rgba(168,85,247,0.6));
}

#timer-number {
    position: absolute;
    font-size: 2.2rem;
    font-weight: 700;
    color: #e9d5ff;
    font-family: 'Lilita One', cursive;
    text-shadow: 0 0 12px rgba(168,85,247,0.6), 0 0 24px rgba(124,58,237,0.3);
    pointer-events: none;
}

#roundIndicator {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    background: rgba(10,1,24,0.6);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    font-family: 'Lilita One', cursive;
}
#roundIndicator.hidden { display: none !important; }

.cg-instruction {
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
    text-align: center;
    margin-bottom: 22px;
    padding: 0 4px;
}
.cg-instruction strong { color: rgba(255,255,255,0.8); }

.cg-timeline-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.cg-timeline-axis {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 0 8px;
}

.cg-axis-label {
    font-family: 'Lilita One', cursive;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.cg-axis-line {
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, rgba(251,191,36,0.7), rgba(168,85,247,0.7));
    border-radius: 2px;
    position: relative;
}
.cg-axis-line::before,
.cg-axis-line::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.cg-axis-line::before { left: 0;  background: rgba(251,191,36,1); }
.cg-axis-line::after  { right: 0; background: rgba(168,85,247,1); }

.cg-cards-row {
    display: flex;
    flex-direction: row;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: clip;
    padding-top: 18px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.cg-slots-row {
    display: flex;
    flex-direction: row;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin-top: 12px;
    padding: 0 2px;
    overflow: hidden;
}

.cg-slot {
    flex: 0 0 250px;
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    overflow: visible;
    transition: transform 0.15s;
}

.cg-slot-pos {
    font-family: system-ui, sans-serif;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cg-slot.cg-slot-hover .cg-slot-pos {
    background: rgba(168,85,247,0.4);
    color: #c084fc;
    transform: scale(1.3);
}

.cg-slot-year {
    font-family: 'Lilita One', cursive;
    font-size: 1.1rem;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: 0.5px;
}
.cg-slot-year-old {
    color: #fbbf24;
    text-shadow: 0 0 14px rgba(251,191,36,0.65);
}
.cg-slot-year-new {
    color: #c084fc;
    text-shadow: 0 0 14px rgba(168,85,247,0.65);
}

.cg-card {
    flex: 0 0 auto;
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(155deg, rgba(62,10,124,0.9) 0%, rgba(18,2,55,0.95) 100%);
    border: 1.5px solid rgba(168,85,247,0.45);
    border-radius: 18px;
    padding: 14px 10px 12px;
    cursor: url('/static/cursor/select.cur'), grab;
    user-select: none;
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s, border-color 0.22s;
    touch-action: pan-x;
    box-shadow: 0 6px 28px rgba(0,0,0,0.55), 0 0 12px rgba(124,58,237,0.12);
    position: relative;
    overflow: hidden;
    animation: cg-card-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
.cg-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 55%);
    pointer-events: none;
}
.cg-card:nth-child(1) { animation-delay: 0.04s; }
.cg-card:nth-child(2) { animation-delay: 0.12s; }
.cg-card:nth-child(3) { animation-delay: 0.20s; }
.cg-card:nth-child(4) { animation-delay: 0.28s; }
.cg-card:nth-child(5) { animation-delay: 0.36s; }
.cg-card:nth-child(6) { animation-delay: 0.44s; }
.cg-card:hover {
    background: linear-gradient(155deg, rgba(104,20,208,0.9) 0%, rgba(42,5,105,0.95) 100%);
    border-color: rgba(200,140,255,0.85);
    box-shadow: 0 16px 44px rgba(0,0,0,0.65), 0 0 32px rgba(168,85,247,0.55);
    transform: translateY(-7px) scale(1.04);
}
.cg-card:active { cursor: url('/static/cursor/select.cur'), grabbing; }

.cg-card img {
    width: 224px;
    height: 230px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    pointer-events: none;
    flex-shrink: 0;
    box-shadow: 0 6px 22px rgba(0,0,0,0.7);
}

.cg-card-name {
    font-size: 1rem;
    color: rgba(255,255,255,0.95);
    line-height: 1.3;
    text-align: center;
    pointer-events: none;
    max-width: 224px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

.cg-card.cg-dragging {
    opacity: 0.22;
    transform: scale(0.94);
}

.cg-card.cg-drag-over {
    border-color: #c084fc;
    background: linear-gradient(155deg, rgba(168,85,247,0.45) 0%, rgba(100,20,200,0.55) 100%);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(192,132,252,0.5), 0 14px 44px rgba(168,85,247,0.4);
}

@keyframes cg-card-in {
    from { transform: translateY(32px) scale(0.88); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.cg-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.92;
    transform: scale(1.04) rotate(1deg);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    border-radius: 14px;
    cursor: grabbing;
    background: rgba(124,58,237,0.7) !important;
    border: 1px solid rgba(168,85,247,0.6) !important;
}

.cg-submit-btn {
    margin-top: 28px;
    align-self: center;
    padding: 16px 56px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: 'Lilita One', cursive;
    font-size: 1.15rem;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(124,58,237,0.5);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    white-space: nowrap;
}
.cg-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124,58,237,0.7);
}
.cg-submit-btn:active { transform: scale(0.98); }
.cg-submit-btn:disabled { opacity: 0.5; cursor: default; transform: none; }

#resultScreen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    overflow-y: auto;
    background: transparent;
    z-index: 1;
}

.cg-result-hero {
    width: 100%;
    padding: 62px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, rgba(124,58,237,0.12) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.cg-result-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    text-align: center;
    background: linear-gradient(135deg, #f0abfc, #c084fc, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(192,132,252,0.4));
    animation: cg-pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes cg-pop-in {
    from { transform: scale(0.7); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.cg-result-score-inline {
    font-family: system-ui, sans-serif;
    font-size: 1rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}
.cg-result-score-inline strong {
    color: #fbbf24;
    font-size: 1.4rem;
    font-family: 'Lilita One', cursive;
    text-shadow: 0 0 14px rgba(251,191,36,0.5);
}

.cg-compare-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    flex: 1;
}

.cg-compare-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 32px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cg-compare-label {
    font-family: 'Lilita One', cursive;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.35);
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cg-compare-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: rgba(255,255,255,0.2);
}

.cg-compare-row:first-child .cg-compare-label::before {
    background: rgba(239,68,68,0.7);
}

.cg-label-correct {
    color: rgba(34,197,94,0.9);
}
.cg-label-correct::before {
    background: rgba(34,197,94,0.8) !important;
}

.cg-compare-cards {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
}

.cg-rc-card {
    flex: 0 0 auto;
    width: 175px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border-radius: 14px;
    padding: 8px 6px 10px;
    border: 2px solid rgba(168,85,247,0.3);
    transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s;
    animation: cg-card-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
    background: linear-gradient(155deg, rgba(52,8,104,0.75) 0%, rgba(15,2,45,0.85) 100%);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.cg-compare-cards .cg-rc-card:nth-child(1) { animation-delay: 0.00s; }
.cg-compare-cards .cg-rc-card:nth-child(2) { animation-delay: 0.07s; }
.cg-compare-cards .cg-rc-card:nth-child(3) { animation-delay: 0.14s; }
.cg-compare-cards .cg-rc-card:nth-child(4) { animation-delay: 0.21s; }
.cg-compare-cards .cg-rc-card:nth-child(5) { animation-delay: 0.28s; }
.cg-compare-cards .cg-rc-card:nth-child(6) { animation-delay: 0.35s; }
.cg-rc-card:hover {
    transform: translateY(-5px) scale(1.04);
    box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 18px rgba(168,85,247,0.35);
}

.cg-rc-card img {
    width: 155px;
    height: 155px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.65);
}

.cg-rc-card .cg-rc-year {
    font-size: 1.1rem;
    font-family: 'Lilita One', cursive;
    color: #fbbf24;
    text-shadow: 0 0 16px rgba(251,191,36,0.65);
    line-height: 1;
}

.cg-rc-card .cg-rc-name {
    font-family: system-ui, sans-serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.88);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 155px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.cg-rc-card .cg-rc-badge {
    font-size: 1.1rem;
}

.cg-rc-card.cg-correct {
    background: linear-gradient(155deg, rgba(10,72,36,0.88) 0%, rgba(5,36,18,0.93) 100%);
    border-color: rgba(34,197,94,0.65);
    box-shadow: 0 0 26px rgba(34,197,94,0.22), 0 6px 22px rgba(0,0,0,0.5);
}
.cg-rc-card.cg-wrong {
    background: linear-gradient(155deg, rgba(82,8,8,0.88) 0%, rgba(46,4,4,0.93) 100%);
    border-color: rgba(239,68,68,0.58);
    box-shadow: 0 0 26px rgba(239,68,68,0.2), 0 6px 22px rgba(0,0,0,0.5);
}

.cg-result-footer {
    width: 100%;
    padding: 16px 32px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.cg-round-score-box {
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 16px;
    padding: 12px 24px;
    backdrop-filter: blur(8px);
}

.cg-rs-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cg-rs-pts {
    font-size: 2rem;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251,191,36,0.5);
    line-height: 1;
    white-space: nowrap;
}

.cg-rs-unit {
    font-size: 0.9rem;
    opacity: 0.6;
}

.cg-rs-pairs {
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.4;
}

.cg-rs-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    border-left: 1px solid rgba(255,255,255,0.08);
    padding-left: 24px;
}

.cg-rs-total-label {
    font-family: system-ui, sans-serif;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cg-rs-total-val {
    font-size: 1.5rem;
    color: #c084fc;
    text-shadow: 0 0 14px rgba(192,132,252,0.4);
    line-height: 1;
}

.cg-next-btn {
    padding: 18px 48px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-family: 'Lilita One', cursive;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(124,58,237,0.5), 0 0 0 1px rgba(168,85,247,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.cg-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 36px rgba(124,58,237,0.7), 0 0 0 1px rgba(168,85,247,0.5);
}

#endScreen {
    max-width: 480px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    min-height: 100vh;
    justify-content: center;
}

.cg-end-crown {
    font-size: 3.5rem;
    filter: drop-shadow(0 0 24px rgba(251,191,36,0.6));
    animation: cg-bounce 2s ease-in-out infinite;
}
@keyframes cg-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.cg-end-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    background: linear-gradient(135deg, #c084fc, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cg-final-score {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    color: #fbbf24;
    text-shadow: 0 0 30px rgba(251,191,36,0.5);
    line-height: 1;
}

.cg-final-breakdown {
    font-family: system-ui, sans-serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.55);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 16px 20px;
}

.cg-bd-row strong { color: #c084fc; }

.cg-end-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.cg-end-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 14px;
    font-family: 'Lilita One', cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cg-end-btn:hover { transform: translateY(-2px); }

.cg-btn-play {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124,58,237,0.5);
}
.cg-btn-home {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
}

/* ── Tablet (≤900px) ── */
@media (max-width: 900px) {
    #gameArea { padding: 170px 16px 80px; }

    .cg-card { width: 180px; }
    .cg-card img { width: 158px; height: 165px; }
    .cg-card-name { font-size: 0.88rem; max-width: 158px; }

    .cg-rc-card { width: 150px; }
    .cg-rc-card img { width: 132px; height: 132px; }
    .cg-rc-card .cg-rc-name { max-width: 132px; }
}

/* ── Mobile landscape / small tablet (≤700px) ── */
@media (max-width: 700px) {
    /* Timer smaller, closer to top */
    #timer-circle-container { width: 90px; height: 90px; top: 14px; }
    #timer-number { font-size: 1.7rem; }
    #roundIndicator { top: 14px; right: 10px; font-size: 0.75rem; padding: 5px 10px; }

    /* Game area — less top padding since timer is smaller */
    #gameArea { padding: 120px 10px 70px; }
    .cg-instruction { font-size: 0.78rem; margin-bottom: 14px; }

    /* Axis labels shorter on mobile */
    .cg-axis-label { font-size: 0.8rem; }
    .cg-timeline-axis { margin-bottom: 12px; }

    /* Cards row scrolls horizontally — reasonable card size */
    .cg-cards-row { gap: 8px; padding-top: 10px; }
    .cg-slots-row { gap: 8px; margin-top: 8px; }
    .cg-slot { flex: 0 0 130px; width: 130px; }
    .cg-card { width: 145px; padding: 14px 8px 14px; }
    .cg-card img { width: 125px; height: 130px; }
    .cg-card-name { font-size: 0.78rem; max-width: 125px; }
    .cg-slot-year { font-size: 0.88rem; }

    /* Submit button */
    .cg-submit-btn { padding: 14px 36px; font-size: 1rem; margin-top: 18px; }

    /* Result screen — tighter hero */
    .cg-result-hero { padding: 54px 16px 12px; }
    .cg-result-title { font-size: clamp(1.5rem, 6vw, 2rem); }
    .cg-compare-row { padding: 10px 16px 10px; gap: 8px; }
    .cg-compare-cards { gap: 8px; }
    .cg-rc-card { width: 120px; }
    .cg-rc-card img { width: 104px; height: 104px; }
    .cg-rc-card .cg-rc-name { font-size: 0.7rem; max-width: 104px; }
    .cg-rc-card .cg-rc-year { font-size: 0.9rem; }

    /* Footer */
    .cg-result-footer { padding: 12px 16px 18px; gap: 14px; }
    .cg-round-score-box { padding: 10px 16px; gap: 16px; }
    .cg-rs-pts { font-size: 1.6rem; }
    .cg-rs-total-val { font-size: 1.2rem; }
    .cg-next-btn { padding: 14px 32px; font-size: 1.1rem; }
}

/* ── Mobile portrait (≤480px) ── */
@media (max-width: 480px) {
    /* Shrink timer further */
    #timer-circle-container { width: 76px; height: 76px; top: 10px; }
    #timer-number { font-size: 1.4rem; }
    #roundIndicator { top: 10px; right: 8px; font-size: 0.7rem; padding: 4px 9px; }

    #gameArea { padding: 100px 6px 64px; }
    .cg-instruction { font-size: 0.72rem; margin-bottom: 10px; }

    .cg-axis-label { font-size: 0.7rem; }

    .cg-cards-row { gap: 6px; padding-top: 8px; }
    .cg-slots-row { gap: 6px; }
    .cg-slot { flex: 0 0 108px; width: 108px; }
    .cg-card { width: 108px; padding: 12px 6px 12px; border-radius: 14px; }
    .cg-card img { width: 92px; height: 96px; border-radius: 10px; }
    .cg-card-name { font-size: 0.7rem; max-width: 92px; }
    .cg-slot-year { font-size: 0.75rem; }

    .cg-submit-btn { padding: 13px 28px; font-size: 0.95rem; }

    /* Result */
    .cg-result-hero { padding: 48px 12px 10px; }
    .cg-result-title { font-size: clamp(1.3rem, 7vw, 1.8rem); }
    .cg-compare-row { padding: 8px 10px 8px; }
    .cg-compare-cards { gap: 6px; }
    .cg-rc-card { width: 100px; padding: 6px 4px 8px; }
    .cg-rc-card img { width: 88px; height: 88px; border-radius: 8px; }
    .cg-rc-card .cg-rc-name { font-size: 0.65rem; max-width: 88px; }
    .cg-rc-card .cg-rc-year { font-size: 0.82rem; }

    .cg-result-footer { padding: 10px 12px 16px; gap: 10px; flex-wrap: wrap; justify-content: center; }
    .cg-round-score-box { padding: 8px 14px; gap: 12px; }
    .cg-rs-pts { font-size: 1.4rem; }
    .cg-rs-total-val { font-size: 1.1rem; }
    .cg-next-btn { padding: 13px 28px; font-size: 1rem; width: 100%; text-align: center; }

    /* End screen */
    #endScreen { padding: 60px 16px 32px; }
}

/* ── Touch-only: even larger grab areas ── */
@media (pointer: coarse) {
    .cg-card { min-height: 160px; }
    .cg-submit-btn { min-height: 52px; }
    .cg-next-btn { min-height: 52px; }
}
