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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #05060c;
    color: #e8f7ff;
    font-family: Rajdhani, Orbitron, "Segoe UI", system-ui, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

canvas#game {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
    outline: none;
    touch-action: none;
}

canvas#game.is-playing {
    cursor: none;
}

.hub-link {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 5;
    color: rgba(232, 247, 255, 0.45);
    font-family: Rajdhani, "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.hub-link:hover,
.hub-link:focus-visible {
    color: #7dfff4;
    background: rgba(125, 255, 244, 0.08);
    outline: none;
}

body.is-loot .hub-link {
    display: none;
}

body.is-settings .hub-link {
    display: none;
}

.save-overlay {
    display: none;
    position: fixed;
    z-index: 8;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    touch-action: auto;
}

body.is-settings .save-overlay {
    display: flex;
}

.save-paste {
    flex: 1 1 auto;
    min-height: 48px;
    width: 100%;
    resize: none;
    background: rgba(5, 7, 14, 0.92);
    color: #e8f7ff;
    border: 1.2px solid rgba(125, 255, 244, 0.5);
    font-family: Rajdhani, Orbitron, "Segoe UI", sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 8px 10px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    touch-action: auto;
}

.save-paste:focus {
    border-color: #7dfff4;
}

.save-overlay-row {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.save-btn {
    flex: 1;
    height: 34px;
    background: rgba(5, 7, 14, 0.82);
    color: #7dfff4;
    border: 1.2px solid rgba(125, 255, 244, 0.5);
    font-family: Rajdhani, Orbitron, "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    touch-action: manipulation;
}

.save-btn:hover,
.save-btn:focus-visible {
    background: rgba(125, 255, 244, 0.18);
    border-color: #7dfff4;
    outline: none;
}

body.is-settings .hub-link {
    display: none;
}

#ns4-save-file {
    display: none;
}

#ns4-save-overlay {
    display: none;
    position: fixed;
    z-index: 8;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
}

body.is-settings #ns4-save-overlay {
    display: flex;
}

#ns4-save-paste {
    flex: 1;
    min-height: 44px;
    resize: none;
    background: rgba(5, 7, 14, 0.94);
    color: #e8f7ff;
    border: 1px solid rgba(125, 255, 244, 0.38);
    border-radius: 6px;
    padding: 8px 10px;
    font-family: Rajdhani, "Segoe UI", sans-serif;
    font-size: 13px;
    letter-spacing: 0.02em;
    outline: none;
    touch-action: auto;
    user-select: text;
    -webkit-user-select: text;
}

#ns4-save-paste:focus {
    border-color: #7dfff4;
}

#ns4-save-apply {
    flex: 0 0 34px;
    height: 34px;
    background: rgba(5, 7, 14, 0.92);
    color: #ffe14a;
    border: 1px solid rgba(255, 225, 74, 0.7);
    border-radius: 6px;
    font-family: Rajdhani, Orbitron, sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
}

#ns4-save-apply:hover,
#ns4-save-apply:focus-visible {
    background: rgba(255, 225, 74, 0.12);
    outline: none;
}
