/*!
 * WPM Handheld Player 1.2.0 - stylesheet
 * Copyright (C) 2026 WPM Productions / A.P.P.L.E. - MIT License.
 * All rules are scoped under .wpmhp to stay theme-safe inside WordPress.
 */

.wpmhp {
    --wpmhp-slab: #23252b;
    --wpmhp-slab-edge: #17181c;
    --wpmhp-well: #101114;
    --wpmhp-ink: #e8e6df;
    --wpmhp-ink-dim: #9b9a93;
    --wpmhp-accent: #7d6bd9;          /* AGB indigo */
    --wpmhp-dmg: #9bbc0f;             /* DMG pea green */
    --wpmhp-gbc: #b06ae0;             /* GBC grape */
    --wpmhp-warn: #e0a13c;
    --wpmhp-radius: 14px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--wpmhp-ink);
    display: flex;
    justify-content: center;
    margin: 1.5em 0;
}

.wpmhp *, .wpmhp *::before, .wpmhp *::after { box-sizing: inherit; }

/* Keyboard-focus cue: with several players on one page, the accent edge
   marks which console currently receives key input. */
.wpmhp.wpmhp-focus .wpmhp-shell {
    outline: 2px solid var(--wpmhp-accent);
    outline-offset: 2px;
}

.wpmhp-shell {
    background: linear-gradient(180deg, var(--wpmhp-slab) 0%, var(--wpmhp-slab-edge) 100%);
    border: 1px solid #000;
    border-radius: var(--wpmhp-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 14px 16px 18px;
    width: 512px;
    max-width: 100%;
}

.wpmhp-shell:fullscreen {
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: auto;
}

/* ---- top plate ------------------------------------------------------- */

.wpmhp-plate {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.wpmhp-title {
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpmhp-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.22em;
    padding: 3px 9px 3px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--wpmhp-ink-dim);
    background: rgba(0, 0, 0, 0.35);
    flex: none;
}

.wpmhp-badge[data-sys="gb"]  { color: var(--wpmhp-dmg);  border-color: var(--wpmhp-dmg);  }
.wpmhp-badge[data-sys="gbc"] { color: var(--wpmhp-gbc);  border-color: var(--wpmhp-gbc);  }
.wpmhp-badge[data-sys="gba"] { color: var(--wpmhp-accent); border-color: var(--wpmhp-accent); }

/* ---- screen ---------------------------------------------------------- */

.wpmhp-screenbox {
    position: relative;
    background: var(--wpmhp-well);
    border: 1px solid #000;
    border-radius: 8px;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.8);
    padding: 10px;
    aspect-ratio: 160 / 144;
    overflow: hidden;
}

.wpmhp-screenbox.wpmhp-drop { outline: 2px dashed var(--wpmhp-accent); outline-offset: -6px; }

.wpmhp-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background: #000;
    image-rendering: pixelated;
    outline: none;
}

.wpmhp-canvas:focus-visible { box-shadow: 0 0 0 2px var(--wpmhp-accent); }

.wpmhp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(10, 10, 12, 0.82);
    text-align: center;
    padding: 16px;
}

.wpmhp-overlay-msg {
    color: var(--wpmhp-ink-dim);
    font-size: 13px;
    max-width: 34em;
}

.wpmhp-overlay-btn {
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--wpmhp-accent);
    border: 0;
    border-radius: 8px;
    padding: 9px 20px;
    cursor: pointer;
}

.wpmhp-overlay-btn:hover { filter: brightness(1.1); }
.wpmhp-overlay-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- status ---------------------------------------------------------- */

.wpmhp-status {
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--wpmhp-ink-dim);
    margin: 8px 2px 6px;
    min-height: 1.3em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpmhp-status-warn { color: var(--wpmhp-warn); }

/* ---- control bars ---------------------------------------------------- */

.wpmhp-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.wpmhp-btn {
    font: inherit;
    font-size: 12px;
    color: var(--wpmhp-ink);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    padding: 6px 10px;
    cursor: pointer;
}

.wpmhp-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.wpmhp-btn:disabled { opacity: 0.4; cursor: default; }
.wpmhp-btn:focus-visible { outline: 2px solid var(--wpmhp-accent); outline-offset: 1px; }

.wpmhp-lbl {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--wpmhp-ink-dim);
    margin-right: 6px;
}

.wpmhp-vol, .wpmhp-speed { display: inline-flex; align-items: center; }

.wpmhp-volinput { width: 110px; accent-color: var(--wpmhp-accent); }

.wpmhp-speedsel {
    font: inherit;
    font-size: 12px;
    color: var(--wpmhp-ink);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    padding: 4px 6px;
}

/* ---- on-screen pad ---------------------------------------------------- */

.wpmhp-pad {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.wpmhp-dpad {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    grid-template-rows: repeat(3, 34px);
    grid-template-areas: ". up ." "left c right" ". down .";
    gap: 2px;
}

.wpmhp-dp {
    font: inherit;
    font-size: 11px;
    color: var(--wpmhp-ink-dim);
    background: #191a1f;
    border: 1px solid #000;
    border-radius: 6px;
    cursor: pointer;
}

.wpmhp-dp-up { grid-area: up; }
.wpmhp-dp-left { grid-area: left; }
.wpmhp-dp-right { grid-area: right; }
.wpmhp-dp-down { grid-area: down; }
.wpmhp-dp-center { grid-area: c; background: #14151a; border-radius: 4px; }

.wpmhp-midbtns { display: flex; gap: 8px; align-self: end; padding-bottom: 4px; }

.wpmhp-pill {
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--wpmhp-ink-dim);
    background: #191a1f;
    border: 1px solid #000;
    border-radius: 999px;
    padding: 6px 12px;
    transform: rotate(-18deg);
    cursor: pointer;
}

.wpmhp-facebtns { display: flex; align-items: center; gap: 8px; }

.wpmhp-round {
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #000;
    color: #fff;
    background: radial-gradient(circle at 35% 30%, #8e7ce6, #574899 70%);
    cursor: pointer;
}

.wpmhp-round-b { margin-top: 16px; }

.wpmhp-shoulder {
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--wpmhp-ink-dim);
    background: #191a1f;
    border: 1px solid #000;
    border-radius: 8px;
    padding: 10px 10px;
    cursor: pointer;
}

.wpmhp-pressed,
.wpmhp-dp:active, .wpmhp-pill:active, .wpmhp-round:active, .wpmhp-shoulder:active {
    filter: brightness(1.35);
    transform: translateY(1px);
}

.wpmhp-pill.wpmhp-pressed, .wpmhp-pill:active { transform: rotate(-18deg) translateY(1px); }

.wpmhp-dp:focus-visible, .wpmhp-pill:focus-visible, .wpmhp-round:focus-visible,
.wpmhp-shoulder:focus-visible { outline: 2px solid var(--wpmhp-accent); outline-offset: 1px; }

/* ---- misc ------------------------------------------------------------- */

.wpmhp-hint {
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--wpmhp-ink-dim);
    margin-top: 12px;
    text-align: center;
}

.wpmhp-hiddenfile { display: none; }

@media (max-width: 560px) {
    .wpmhp-shell { width: 100% !important; padding: 10px 10px 14px; }
    .wpmhp-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .wpmhp * { transition: none !important; }
}
