:root {
    --bg-dark: #0a0a0c;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: #8a8a93;
    --accent-1: #4f46e5;
    --accent-2: #e11d48;
    --accent-3: #0ea5e9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'InterVariable', 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Orbs */
.background-orbs {
    position: absolute;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
}

.orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.4;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-2);
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-3);
    top: 30%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    z-index: 1;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.app-icon img {
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0% { transform: translateY(0px); filter: drop-shadow(0 0 18px rgba(79, 70, 229, 0.4)); }
    50% { transform: translateY(-10px); filter: drop-shadow(0 0 25px rgba(16, 185, 129, 0.6)); }
    100% { transform: translateY(0px); filter: drop-shadow(0 0 18px rgba(79, 70, 229, 0.4)); }
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-weight: 300;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Output Area */
.output-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.output-box {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-all;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.2);
}

.output-box.loading {
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 300;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.copy-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Controls */
.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

input:focus, select:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

select option {
    background: var(--bg-dark);
    color: #fff;
}

/* Digit position and count are dimmed, not hidden, while digits are off. Hiding a
   cell would collapse it out of the two-column grid and shift every later control
   under the pointer, so the layout stays put and the controls just read as inert. */
.control-group.is-disabled {
    opacity: 0.4;
}

input:disabled, select:disabled {
    cursor: not-allowed;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn span {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    z-index: 1;
    animation: btn-shine 3s infinite;
}

@keyframes btn-shine {
    0% { transform: rotate(45deg) translateY(-100%); }
    100% { transform: rotate(45deg) translateY(100%); }
}

@media (max-width: 500px) {
    .controls {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Strength readout ---------------------------------------------------------
   Sits between the username and the controls because it is a consequence of the
   controls and a property of the username, and reads as neither if it is put
   below the Generate button. Deliberately quiet: it is a fact about the current
   settings, not a verdict on them, and nothing here is colour-coded green or
   red because "strong" is a judgement this app has no business making about a
   username, which is not a password. */
.strength {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    margin: -4px 0 20px;
    text-align: center;
}

.strength-bits {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--accent-3);
    letter-spacing: 0.01em;
}

.strength-detail {
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* The two figures are one sentence on a phone and would otherwise break in the
   middle of "90 thousand". */
@media (max-width: 420px) {
    .strength-detail { max-width: 30ch; }
}

/* Language warning marker -------------------------------------------------
   Shown on hover AND focus, and reachable by keyboard via tabindex, because a
   warning only a mouse can reveal is not a warning for everyone. */
.hint {
    position: relative;
    display: inline-block;
    margin-left: 3px;
    color: var(--accent-3);
    cursor: help;
    font-weight: 700;
}

.hint-bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: max-content;
    max-width: 264px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #16161c;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, transform 0.16s ease;
    z-index: 20;
}

.hint:hover .hint-bubble,
.hint:focus .hint-bubble,
.hint:focus-visible .hint-bubble {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Max entropy ------------------------------------------------------------- */
.max-entropy-btn {
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font: inherit;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease;
}

.max-entropy-btn:hover,
.max-entropy-btn:focus-visible {
    border-color: var(--accent-3);
    color: var(--accent-3);
}

.max-hint {
    margin-top: 6px;
    font-size: 0.7rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.38);
    max-width: 34ch;
    text-align: center;
}

/* Reads as a statement of fact when you are already there, not as a nudge. */
.max-hint.is-max { color: var(--accent-3); }

/* Android app store links ---------------------------------------------------
   Same quiet outlined pill as Max entropy, a little larger so it is an easy tap
   target. Plain text on purpose: no official store badge artwork, and nothing
   loaded from the stores' own servers. Added 2026-10-02. */
.store-links {
    margin-top: 2.5rem;
    text-align: center;
}

.store-links h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
}

.store-links p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.store-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.store-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 0.6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: border-color 0.16s ease, color 0.16s ease;
}

.store-link:hover,
.store-link:focus-visible {
    border-color: var(--accent-3);
    color: var(--accent-3);
}

.store-link:focus-visible {
    outline: 2px solid var(--accent-3);
    outline-offset: 2px;
}

/* Read by screen readers, not shown. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
