/* =================================================================
   DONICRAFT — HUD & UI STYLES
   Modern sharp Minecraft/Tech aesthetic
   ================================================================= */

/* -----------------------------------------------------------------
   1. RESET & VARIABLES
   ----------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Backgrounds */
    --bg-dark:          #05070b;
    --bg-panel:         rgba(16, 20, 28, 0.96);
    --bg-panel-soft:    rgba(24, 30, 40, 0.85);
    --bg-slot:          rgba(10, 14, 20, 0.85);

    /* Borders */
    --border-soft:      rgba(120, 140, 170, 0.20);
    --border-mid:       rgba(120, 140, 170, 0.35);
    --border-strong:    rgba(92, 255, 143, 0.55);

    /* Accents */
    --accent:           #5cff8f;
    --accent-dim:       #2a7f4a;
    --accent-glow:      rgba(92, 255, 143, 0.35);
    --gold:             #ffb84d;
    --gold-glow:        rgba(255, 184, 77, 0.35);
    --danger:           #ff4d5a;
    --danger-glow:      rgba(255, 77, 90, 0.4);

    /* Text */
    --text-primary:     #e8edf5;
    --text-secondary:   #8b95a8;
    --text-dim:         #5a6478;

    /* Stat colors */
    --hp-red:           #ff4d5a;
    --hunger-gold:      #ffb84d;

    /* Fonts */
    --font-display:     'Oxanium', 'Segoe UI', sans-serif;
    --font-body:        'Space Grotesk', 'Segoe UI', system-ui, sans-serif;

    /* Layout */
    --slot-size:        52px;
    --hotbar-slot-size: 56px;
}

/* -----------------------------------------------------------------
   2. BASE
   ----------------------------------------------------------------- */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#game-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #0a1220;
    cursor: crosshair;
    outline: none;
}

.hidden {
    display: none !important;
}

/* -----------------------------------------------------------------
   3. OVERLAYS
   ----------------------------------------------------------------- */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background:
        radial-gradient(ellipse at center, rgba(10, 15, 25, 0.65) 0%, rgba(5, 7, 11, 0.94) 100%);
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* -----------------------------------------------------------------
   4. MENU PANELS
   ----------------------------------------------------------------- */
.menu-panel {
    position: relative;
    background: var(--bg-panel);
    border: 2px solid var(--border-soft);
    box-shadow:
        0 0 60px rgba(92, 255, 143, 0.12),
        0 30px 80px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35);
    padding: 40px 56px;
    min-width: 420px;
    max-width: 92vw;
    text-align: center;
    animation: panelIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.menu-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 12px var(--accent);
    pointer-events: none;
}

.controls-panel {
    padding: 32px 48px;
    min-width: 480px;
}

/* -----------------------------------------------------------------
   5. TYPOGRAPHY
   ----------------------------------------------------------------- */
.menu-title {
    font-family: var(--font-display);
    font-size: 68px;
    font-weight: 800;
    letter-spacing: 8px;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #5cff8f 55%, #2a7f4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 0 24px rgba(92, 255, 143, 0.45));
}

.menu-title.small {
    font-size: 44px;
    letter-spacing: 6px;
}

.menu-subtitle {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 8px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    text-transform: uppercase;
}

.menu-subtitle.small {
    margin-bottom: 24px;
}

.panel-heading {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent);
    margin-bottom: 24px;
    text-shadow: 0 0 14px var(--accent-glow);
}

/* -----------------------------------------------------------------
   6. BUTTONS
   ----------------------------------------------------------------- */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.mc-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 14px 28px;
    color: var(--text-primary);
    background: linear-gradient(180deg, #232a36 0%, #141820 100%);
    border: 2px solid var(--border-mid);
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease,
        transform 0.08s ease;
    overflow: hidden;
    isolation: isolate;
}

.mc-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(92, 255, 143, 0.0), rgba(92, 255, 143, 0.0));
    transition: background 0.15s ease;
    z-index: -1;
}

.mc-button:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow:
        0 0 22px rgba(92, 255, 143, 0.35),
        inset 0 0 20px rgba(92, 255, 143, 0.08);
}

.mc-button:hover::before {
    background: linear-gradient(180deg, rgba(92, 255, 143, 0.05), rgba(92, 255, 143, 0.12));
}

.mc-button:active {
    transform: translateY(1px);
}

.mc-button.primary {
    background: linear-gradient(180deg, #2f5a3e 0%, #1a3223 100%);
    border-color: var(--accent-dim);
    color: var(--text-primary);
}

.mc-button.primary:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow:
        0 0 30px rgba(92, 255, 143, 0.5),
        inset 0 0 24px rgba(92, 255, 143, 0.15);
}

.mc-button.danger {
    background: linear-gradient(180deg, #3a1c22 0%, #210f13 100%);
    border-color: rgba(255, 77, 90, 0.5);
    color: #ff9ba3;
}

.mc-button.danger:hover {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow:
        0 0 22px var(--danger-glow),
        inset 0 0 20px rgba(255, 77, 90, 0.12);
}

.mode-button {
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
}

.mode-button .btn-label {
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 4px;
}

.mode-button .btn-value {
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* -----------------------------------------------------------------
   7. MENU FOOTER
   ----------------------------------------------------------------- */
.menu-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 4px;
    color: var(--text-dim);
    margin-top: 8px;
}

.menu-footer .dot {
    color: var(--accent-dim);
}

/* -----------------------------------------------------------------
   8. CONTROLS PANEL
   ----------------------------------------------------------------- */
.controls-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 24px;
    text-align: left;
    margin-bottom: 24px;
    max-width: 520px;
}

.ctrl-key {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.ctrl-desc {
    color: var(--text-secondary);
    font-size: 13px;
    letter-spacing: 0.5px;
    align-self: center;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    background: linear-gradient(180deg, #2a3140 0%, #1a1f2a 100%);
    border: 1px solid var(--border-mid);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.4);
}

/* -----------------------------------------------------------------
   9. LOADING SCREEN
   ----------------------------------------------------------------- */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.loading-logo {
    font-family: var(--font-display);
    font-size: 68px;
    font-weight: 800;
    letter-spacing: 10px;
    color: var(--accent);
    text-shadow: 0 0 40px var(--accent-glow);
    animation: logoPulse 2.2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { opacity: 1;   text-shadow: 0 0 40px var(--accent-glow); }
    50%      { opacity: 0.7; text-shadow: 0 0 80px var(--accent); }
}

.loading-subtitle {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 8px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.loading-bar-track {
    width: 420px;
    max-width: 80vw;
    height: 8px;
    background: rgba(30, 38, 50, 0.8);
    border: 1px solid var(--border-soft);
    position: relative;
    overflow: hidden;
}

.loading-bar-track::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.03) 0 6px,
        transparent 6px 12px
    );
    pointer-events: none;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    box-shadow: 0 0 20px var(--accent-glow);
    transition: width 0.25s ease-out;
}

.loading-status {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-top: 14px;
    text-transform: uppercase;
}

/* -----------------------------------------------------------------
   10. HUD
   ----------------------------------------------------------------- */
#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

/* ---- Crosshair ---- */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    pointer-events: none;
    z-index: 45;
    opacity: 0.85;
    mix-blend-mode: difference;
}

#crosshair::before,
#crosshair::after {
    content: '';
    position: absolute;
    background: #ffffff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
}

#crosshair::before {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

#crosshair::after {
    width: 100%;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* ---- Block-Info ---- */
#block-info {
    position: fixed;
    top: calc(50% + 30px);
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 14px;
    background: rgba(8, 12, 18, 0.82);
    border: 1px solid var(--border-soft);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 45;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* ---- Bottom HUD (Hotbar + Stats) ---- */
#hud-bottom {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    z-index: 50;
}

/* ---- Stat Bars (Health & Hunger) ---- */
#stat-bars {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 22px;
}

.stat-bar {
    display: flex;
    align-items: center;
}

.stat-pips {
    display: flex;
    gap: 3px;
    height: 100%;
    align-items: center;
}

.stat-pip {
    width: 18px;
    height: 10px;
    background: var(--hp-red);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 0 8px rgba(255, 77, 90, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

#hunger-pips .stat-pip {
    background: var(--hunger-gold);
    box-shadow:
        0 0 8px rgba(255, 184, 77, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.stat-pip.half {
    background: linear-gradient(
        90deg,
        var(--hp-red) 50%,
        rgba(50, 20, 25, 0.85) 50%
    );
}

#hunger-pips .stat-pip.half {
    background: linear-gradient(
        90deg,
        var(--hunger-gold) 50%,
        rgba(50, 40, 20, 0.85) 50%
    );
}

.stat-pip.empty {
    background: rgba(40, 20, 25, 0.75);
    box-shadow: none;
}

#hunger-pips .stat-pip.empty {
    background: rgba(40, 32, 20, 0.75);
}

/* ---- Hotbar ---- */
#hotbar {
    display: flex;
    gap: 4px;
    padding: 6px;
    background: rgba(8, 12, 18, 0.78);
    border: 2px solid var(--border-soft);
    box-shadow:
        0 4px 30px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hotbar-slot {
    position: relative;
    width: var(--hotbar-slot-size);
    height: var(--hotbar-slot-size);
    background: var(--bg-slot);
    border: 2px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.12s ease;
}

.hotbar-slot:hover {
    border-color: var(--accent-dim);
}

.hotbar-slot.active {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.06);
    box-shadow:
        0 0 22px var(--accent-glow),
        inset 0 0 18px rgba(92, 255, 143, 0.18);
    z-index: 2;
}

.hotbar-slot .slot-content,
.slot .slot-content {
    width: 100%;
    height: 100%;
    background-size: 80% 80%;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    pointer-events: none;
}

.hotbar-slot .slot-count,
.slot .slot-count {
    position: absolute;
    bottom: 1px;
    right: 4px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    text-shadow:
        1px 1px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    pointer-events: none;
    line-height: 1;
}

/* -----------------------------------------------------------------
   11. NOTIFICATION AREA
   ----------------------------------------------------------------- */
#notification-area {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
    pointer-events: none;
    z-index: 55;
}

.notification {
    padding: 10px 16px;
    background: rgba(16, 20, 28, 0.94);
    border-left: 3px solid var(--accent);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
    animation: notifIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.05);
    word-wrap: break-word;
}

.notification.danger {
    border-left-color: var(--danger);
}

.notification.gold {
    border-left-color: var(--gold);
}

@keyframes notifIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -----------------------------------------------------------------
   12. DEBUG HUD (F3)
   ----------------------------------------------------------------- */
#debug-hud {
    position: fixed;
    top: 14px;
    left: 14px;
    padding: 12px 16px;
    background: rgba(8, 12, 18, 0.88);
    border: 1px solid var(--border-soft);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 0.5px;
    line-height: 1.65;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 60;
    min-width: 260px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.debug-line {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(92, 255, 143, 0.25);
    text-shadow: 0 0 8px var(--accent-glow);
}

#debug-content > div {
    white-space: pre;
}

#debug-content > div span.k {
    color: var(--text-dim);
}

#debug-content > div span.v {
    color: var(--text-primary);
    font-weight: 600;
}

/* -----------------------------------------------------------------
   13. INVENTORY OVERLAY
   ----------------------------------------------------------------- */
#inventory-overlay {
    align-items: center;
    justify-content: center;
    z-index: 120;
    background: rgba(5, 7, 11, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.inventory-panel {
    background: var(--bg-panel);
    border: 2px solid var(--border-soft);
    box-shadow:
        0 0 80px rgba(92, 255, 143, 0.10),
        0 30px 80px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 20px 28px 28px;
    max-width: 94vw;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    animation: panelIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}

.inventory-panel::-webkit-scrollbar {
    width: 8px;
}
.inventory-panel::-webkit-scrollbar-track {
    background: rgba(10, 14, 20, 0.6);
}
.inventory-panel::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
}
.inventory-panel::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.inventory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.inventory-header h2 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}

.close-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, #2a3140 0%, #141820 100%);
    border: 2px solid var(--border-mid);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 16px var(--danger-glow);
}

.inventory-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.section-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.crafting-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: rgba(10, 14, 20, 0.55);
    border: 1px solid var(--border-soft);
}

.crafting-container {
    display: flex;
    flex-direction: column;
}

.crafting-layout {
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.crafting-grid {
    display: grid;
    gap: 4px;
    padding: 8px;
    background: rgba(5, 8, 12, 0.6);
    border: 1px solid var(--border-soft);
    width: max-content;
}

.crafting-grid.craft-2 {
    grid-template-columns: repeat(2, var(--slot-size));
    grid-template-rows: repeat(2, var(--slot-size));
}

.crafting-grid.craft-3 {
    grid-template-columns: repeat(3, var(--slot-size));
    grid-template-rows: repeat(3, var(--slot-size));
}

.craft-arrow {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    font-family: var(--font-display);
    user-select: none;
}

.crafting-result-slot {
    width: 60px;
    height: 60px;
    background: rgba(10, 20, 14, 0.85);
    border: 2px solid var(--accent-dim);
    box-shadow: inset 0 0 16px rgba(92, 255, 143, 0.08);
}

.crafting-result-slot.has-item {
    box-shadow: 0 0 20px var(--accent-glow);
}

.inventory-grid-section {
    display: flex;
    flex-direction: column;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--slot-size));
    gap: 4px;
    padding: 8px;
    background: rgba(5, 8, 12, 0.6);
    border: 1px solid var(--border-soft);
    width: max-content;
    margin: 0 auto;
}

/* -----------------------------------------------------------------
   14. SLOT (generic, used in inventory, crafting, etc.)
   ----------------------------------------------------------------- */
.slot {
    position: relative;
    width: var(--slot-size);
    height: var(--slot-size);
    background: var(--bg-slot);
    border: 2px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        border-color 0.12s ease,
        box-shadow 0.12s ease,
        transform 0.08s ease;
}

.slot:hover {
    border-color: var(--accent);
    box-shadow: inset 0 0 14px rgba(92, 255, 143, 0.12);
    z-index: 2;
}

.slot.selected {
    border-color: var(--accent);
    box-shadow:
        0 0 16px var(--accent-glow),
        inset 0 0 14px rgba(92, 255, 143, 0.18);
    transform: scale(1.02);
}

.slot.empty-result {
    cursor: default;
    opacity: 0.55;
}

.slot.empty-result:hover {
    border-color: var(--border-mid);
    box-shadow: none;
}

.slot.filled .slot-content {
    background-size: 80% 80%;
}

/* -----------------------------------------------------------------
   15. TOOLTIP & DRAG GHOST
   ----------------------------------------------------------------- */
#item-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 250;
    padding: 6px 12px;
    background: rgba(16, 20, 28, 0.96);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    white-space: nowrap;
    box-shadow: 0 0 20px rgba(92, 255, 143, 0.22);
}

#item-tooltip .tt-count {
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    margin-left: 8px;
}

#drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 300;
    width: var(--slot-size);
    height: var(--slot-size);
    background-size: 80% 80%;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    opacity: 0.85;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

/* -----------------------------------------------------------------
   16. RESPONSIVE
   ----------------------------------------------------------------- */
@media (max-width: 900px) {
    .menu-panel {
        padding: 28px 32px;
        min-width: 0;
        width: 90vw;
    }
    .menu-title {
        font-size: 48px;
        letter-spacing: 5px;
    }
    .menu-title.small {
        font-size: 34px;
    }
    .loading-logo {
        font-size: 44px;
        letter-spacing: 6px;
    }
    .controls-panel {
        min-width: 0;
        padding: 24px 20px;
    }
    .inventory-grid {
        grid-template-columns: repeat(9, 40px);
    }
    :root {
        --slot-size: 40px;
        --hotbar-slot-size: 44px;
    }
}

@media (max-width: 640px) {
    .menu-title {
        font-size: 36px;
        letter-spacing: 4px;
    }
    .mc-button {
        font-size: 13px;
        letter-spacing: 2px;
        padding: 12px 20px;
    }
    #hotbar {
        gap: 2px;
        padding: 4px;
    }
    :root {
        --slot-size: 34px;
        --hotbar-slot-size: 38px;
    }
    #stat-bars {
        gap: 20px;
    }
    .stat-pip {
        width: 12px;
        height: 8px;
    }
}

/* -----------------------------------------------------------------
   17. FOCUS / ACCESSIBILITY
   ----------------------------------------------------------------- */
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::selection {
    background: var(--accent);
    color: var(--bg-dark);
}