/* ============================================
   PIXEL KITTY SPEEDOMETER - high contrast dark theme
   API/IDs sama seperti sebelumnya, hanya tampilan baru.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ---- Palette ----
   bg      : #14101f (ungu-hitam)
   panel   : #221b33
   ink     : #ffffff (teks utama)
   pink    : #ff4d8d (aksen kucing)
   pink-lt : #ff9ec4
   cyan    : #3ee6ff
   yellow  : #ffd93d
   green   : #52ff7a
   red     : #ff3b3b
---------------------------------------------- */
:root {
    --bg: #14101f;
    --panel: #221b33;
    --panel-2: #2c2342;
    --ink: #ffffff;
    --muted: #cfc6e6;
    --pink: #ff4d8d;
    --pink-lt: #ff9ec4;
    --cyan: #3ee6ff;
    --yellow: #ffd93d;
    --green: #52ff7a;
    --red: #ff3b3b;
    --line: #ffffff;
}

/* Theme hook kept for compatibility (same look) */
.theme-barbie { --pink: #ff4d8d; }

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

html, body {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0) !important; /* transparan untuk game */
    font-family: 'Nunito', sans-serif;
    overflow: hidden;
}

/* ---- HUD Positioning ---- */
.speedometer-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: #ffffff;
    border: 3px solid #1a1a1a;
    border-radius: 18px;
    box-shadow:
        6px 6px 0 var(--pink),
        0 0 22px rgba(255, 77, 141, 0.55);
    padding: 12px 14px 10px;
    animation: hud-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 2.8s both;
    user-select: none;
    pointer-events: none;
}

@keyframes hud-appear {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Theme Toggle Button (unused, kept) */
.theme-toggle-btn { display: none; }

/* === TOP BAR === */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.indicator-group {
    display: flex;
    gap: 6px;
    align-items: center;
    background: #000;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 4px 10px;
}

.indicator {
    color: #4a4258;
    display: flex;
    align-items: center;
}
.indicator svg { width: 26px; height: 26px; }

.indicator.active {
    color: var(--yellow);
    filter: drop-shadow(0 0 8px var(--yellow));
    animation: blink 0.55s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.15; }
}

.engine-status-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #000;
    border: 2px solid var(--line);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 10px;
    font-weight: 900;
}

.status-label {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 0.06em;
}

.status-value {
    color: var(--ink);
    font-weight: 900;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #5a5266;
    border: 1px solid var(--line);
}

.status-dot.engine-on {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

/* === SPEED PANEL === */
.speed-panel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px;
    background: #ffeef5;
    border: 2px solid var(--pink);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}

/* --- Logo kucing --- */
.logo-deco {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 50%;
    border: 3px solid var(--pink);
    box-shadow: 0 0 10px rgba(255, 77, 141, 0.7);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated; /* jaga ketajaman pixel art */
}

.speed-info-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.personal-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--yellow);
    background: #000;
    border: 2px solid var(--yellow);
    padding: 4px 8px;
    border-radius: 8px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.speed-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.speed-number {
    font-size: 62px;
    font-weight: 900;
    line-height: 1;
    color: #1a1a1a;
    text-shadow:
        3px 3px 0 var(--pink-lt);
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}

.speed-unit {
    font-size: 13px;
    font-weight: 900;
    color: #000;
    background: var(--cyan);
    border: 2px solid var(--line);
    border-radius: 8px;
    padding: 2px 8px;
}

/* === RPM SECTION === */
.rpm-section {
    margin-bottom: 10px;
    background: #000;
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 7px 10px 6px;
}

.rpm-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.rpm-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: var(--pink-lt);
}

.rpm-value {
    font-size: 12px;
    font-weight: 900;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.rpm-bar-track {
    width: 100%;
    height: 12px;
    background: #2a2438;
    border-radius: 8px;
    border: 2px solid var(--line);
    overflow: hidden;
}

.rpm-bar-fill {
    height: 100%;
    width: 0%;
    background:
        repeating-linear-gradient(90deg,
            rgba(0,0,0,0.25) 0 6px,
            rgba(0,0,0,0) 6px 14px),
        linear-gradient(90deg, var(--green) 0%, var(--yellow) 55%, var(--red) 100%);
    transition: width 0.12s ease;
}

.rpm-bar-markers {
    display: flex;
    justify-content: space-between;
    padding: 3px 1px 0;
    font-size: 8px;
    font-weight: 800;
    color: var(--muted);
}

/* --- Info Grid --- */
.info-grid {
    display: grid;
    grid-template-columns: 64px 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.info-card {
    background: #ffeef5;
    border: 2px solid var(--pink);
    border-radius: 12px;
    padding: 6px 8px;
}

.info-card-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 7px;
    color: #c2145e;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.info-card-value {
    font-size: 14px;
    font-weight: 900;
    color: #1a1a1a;
}

.gear-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--pink);
    border-color: var(--line);
}

.gear-card .info-card-label { color: #000; }

.gear-value {
    font-size: 30px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 2px 2px 0 #000;
}

/* Bars */
.fuel-bar-wrap, .health-bar-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.fuel-bar-track, .health-bar-track {
    flex: 1;
    height: 10px;
    background: #000;
    border-radius: 8px;
    border: 2px solid var(--line);
    overflow: hidden;
}

.fuel-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--cyan);
}
.health-bar-fill {
    height: 100%;
    width: 100%;
    background: var(--green);
}

.fuel-bar-fill.low, .health-bar-fill.low {
    background: var(--red);
    animation: blink 0.5s step-end infinite;
}

.fuel-percent, .health-percent {
    font-size: 11px;
    font-weight: 900;
    color: #1a1a1a;
    min-width: 34px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* === WELCOME OVERLAY (seukuran + seposisi speedometer) === */
.welcome-overlay {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    z-index: 10000;
    background: #fff;
    border: 3px solid #1a1a1a;
    border-radius: 18px;
    box-shadow:
        6px 6px 0 var(--pink),
        0 0 22px rgba(255, 77, 141, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 14px 10px;
    pointer-events: none;
    animation: welcome-hide 0.5s ease 2.3s forwards;
}

.welcome-img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--pink);
    box-shadow: 0 0 16px rgba(255, 77, 141, 0.6);
    image-rendering: pixelated;
    animation: welcome-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.welcome-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    color: var(--pink);
    text-shadow: 2px 2px 0 #1a1a1a;
    animation: welcome-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes welcome-pop {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes welcome-hide {
    to { opacity: 0; visibility: hidden; }
}

/* === ODOMETER BAR === */
.odometer-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #000;
    border-radius: 10px;
    border: 2px solid var(--yellow);
    color: var(--yellow);
}

.odo-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--yellow);
}

.odo-value {
    font-size: 12px;
    font-weight: 900;
    color: var(--ink);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}
