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

html {
    color-scheme: only dark;
}

body {
    font-family: "Minecraftia";
    background: #0a0a0a;
    color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    position: relative;
    background: #171717;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

h1 {
    color: #f5f5f5;
    font-size: 18px;
    font-weight: normal;
    margin: 0 0 12px 0;
    text-align: center;
}

#go-back-btn {
    font-family: "Minecraftia";
    align-self: center;
    margin-top: 4px;
    margin-bottom: -8px;
    font-size: 14px;
    padding: 0;
    color: lightgray;
    text-decoration: none;
}

#go-back-btn:hover {
    text-decoration: underline;
}

label {
    color: #a3a3a3;
    font-size: 12px;
    margin: 0;
}

input[type="number"] {
    padding: 10px 12px;
    font-size: 14px;
    font-family: "Minecraftia";
    border: 1px solid #525252;
    background: #0a0a0a;
    color: #f5f5f5;
    border-radius: 4px;
    outline: none;
}

input[type="number"].no-increment-buttons::-webkit-outer-spin-button,
input[type="number"].no-increment-buttons::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

input[type="number"].no-increment-buttons {
    appearance: textfield;
}

.result {
    min-height: 40px;
    padding: 12px;
    background: #0a0a0a;
    border: 1px solid #525252;
    border-radius: 4px;
    font-size: 14px;
    color: #a3a3a3;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.result-text {
    text-align: center;
    width: 100%;
}

.result.show {
    color: #f5f5f5;
    border-color: #86efac;
}

.copy-btn {
    position: absolute;
    right: 8px;
    padding: 6px;
    font-size: 14px;
    color: #a3a3a3;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    width: 28px;
    height: 28px;
}

.copy-btn:hover:not(:disabled) {
    color: #f5f5f5;
    background: rgba(64, 64, 64, 0.3);
}

.copy-btn:hover:not(:disabled) .tooltip {
    opacity: 1;
    visibility: visible;
}

.copy-btn:focus-visible {
    outline: 1px solid #86efac;
    outline-offset: 1px;
}

.copy-btn.copied {
    color: #86efac;
}

.copy-btn.copied:hover {
    color: #86efac;
}

.copy-btn:disabled {
    color: #525252;
    cursor: not-allowed;
    opacity: 0.5;
}

.copy-btn:disabled .tooltip {
    display: none;
}

.icon-copy {
    position: absolute;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(1) rotate(0deg);
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

.icon-checkmark {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scale(0.8) rotate(-10deg);
    left: 50%;
    top: 50%;
    margin-left: -8px;
    margin-top: -8px;
}

.copy-btn.copied .icon-copy {
    opacity: 0;
    transform: scale(0.8) rotate(10deg);
}

.copy-btn.copied .icon-checkmark {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #171717;
    color: #f5f5f5;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    border: 1px solid #404040;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.copy-btn:hover:not(:disabled) .tooltip {
    opacity: 1;
    visibility: visible;
}

.copy-btn.copied .tooltip {
    opacity: 0 !important;
    visibility: hidden !important;
}

.help-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
}

.help-popup-overlay.open {
    display: flex;
}

.help-popup {
    background: #171717;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 24px;
    width: 670px;
    max-width: calc(100vw - 40px);
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.help-popup p {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: #a3a3a3;
    font-size: 13px;
}

.help-popup-close {
    position: absolute;
    padding: 8px;
    top: 1px;
    right: 3px;
    background: transparent;
    border: none;
    color: #a3a3a3;
    font-size: 18px;
    cursor: pointer;
}

.help-popup-close:hover {
    color: #f5f5f5;
}

#help-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #a3a3a3;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
}

#help-btn:hover {
    color: #f5f5f5;
}
