/* ============================================
   MAIN STYLES - NULL-MAGIC MANTDLE
   Shared styles for all game modes
   ============================================ */

/* === CORE LAYOUT === */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121214;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    margin: 0;
}

.game-container {
    width: 100%;
    max-width: 1050px;
    text-align: center;
}

/* === HEADER === */
h1 {
    color: #f0e6d2;
    margin-bottom: 5px;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.subtitle {
    color: #a0a0a0;
    margin-bottom: 15px;
}

.title-icon {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 2px solid #c8aa6e;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    margin-bottom: 15px;
}

.header-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === BUTTONS === */
.toolbar-btn,
.mode-dropdown,
.patch-btn,
.settings-btn,
.game-btn {
    background: #2a2a30;
    color: #a0a0a0;
    border: 1px solid #3c3c41;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    outline: none;
}

.toolbar-btn:hover,
.mode-dropdown:hover,
.patch-btn:hover,
.settings-btn:hover,
.game-btn:hover {
    border-color: #c8aa6e;
    color: #c8aa6e;
}

.dev-btn {
    background-color: #c8aa6e;
    color: #121214;
    border: none;
    padding: 8px 12px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
}

.dev-btn:hover {
    background-color: #e0ca9e;
}

.next-btn {
    background: #c8aa6e;
    color: #1a1a1f;
    border-color: #c8aa6e;
}

.next-btn:hover {
    background: #e2c282;
    color: #1a1a1f;
}

.reveal-btn:hover {
    border-color: #ff4655;
    color: #ff4655;
}

/* === INPUT AREA === */
.input-area {
    position: relative;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

input {
    width: 350px;
    padding: 12px;
    background-color: #1e1e22;
    border: 2px solid #3c3c41;
    color: white;
    border-radius: 4px;
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: #c8aa6e;
}

input:disabled {
    background-color: #333;
    cursor: not-allowed;
}

/* === SUGGESTIONS DROPDOWN === */
.suggestions {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 350px;
    background: #1e1e22;
    border: 1px solid #3c3c41;
    border-top: none;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    border-radius: 0 0 4px 4px;
}

.suggestions:empty {
    border: none;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.suggestion-item:hover {
    background-color: #2a2a30;
    color: #c8aa6e;
}

/* === RESULTS TABLE === */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
    margin-top: 20px;
    perspective: 1000px;
}

th {
    color: #a0a0a0;
    font-weight: 600;
    padding-bottom: 5px;
    font-size: 13px;
    position: relative;
    z-index: 30;
}

td {
    padding: 0;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    border-radius: 4px;
    vertical-align: middle;
    height: 80px;
    background-color: transparent;
}

/* === FLIP ANIMATION === */
.flip-container {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.flip-animate {
    animation: wordleTopDownFlip 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    padding: 6px;
}

.card-front {
    background-color: #1e1e22;
    border: 1px solid #3c3c41;
    color: #ffffff;
}

.card-back {
    transform: rotateX(180deg);
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

@keyframes wordleTopDownFlip {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(180deg); }
}

/* === ITEM CELL === */
.item-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.item-cell img {
    width: 36px;
    height: 36px;
    border-radius: 0px !important;
    border: 1px solid #555;
    flex-shrink: 0;
}

.item-cell span {
    font-size: 11px;
    word-break: break-word;
}

/* === CELL COLORS === */
.correct {
    background-color: #1c773e !important;
}

.partial {
    background-color: #b58900 !important;
}

.wrong {
    background-color: #aa3838 !important;
}

/* === COLORBLIND MODE === */
body.colorblind-mode .correct {
    background-color: #005fcc !important;
}

body.colorblind-mode .partial {
    background-color: #ffcc00 !important;
    color: #121214 !important;
}

body.colorblind-mode .wrong {
    background-color: #ff6b00 !important;
}

/* === TOOLTIPS === */
.tooltip {
    cursor: help;
    border-bottom: 1px dotted #777;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 210px;
    background-color: #1c1c22;
    color: #fff;
    text-align: center;
    border: 1px solid #c8aa6e;
    border-radius: 5px;
    padding: 8px 10px;
    position: absolute;
    z-index: 20;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 11px;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateZ(10px);
}

/* === LEGEND BOX === */
.legend-box {
    background-color: #1c1c22;
    border: 1px solid #3c3c41;
    border-radius: 6px;
    padding: 12px;
    max-width: 450px;
    margin: 0 auto 25px auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.legend-title {
    font-size: 13px;
    font-weight: bold;
    color: #c8aa6e;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.legend-items {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* === DRAGGABLE LEGEND WINDOW === */
.draggable-window {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: #1a1a1f;
    border: 2px solid #3c3c41;
    border-radius: 6px;
    width: 260px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.legend-header {
    background: #24242a;
    border-bottom: 1px solid #3c3c41;
    padding: 8px 12px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #c8aa6e;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.legend-close-x {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.legend-close-x:hover {
    color: #ff4655;
}

.legend-body {
    padding: 12px;
    text-align: left;
}

.legend-row-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #a0a0a0;
}

.legend-row-item:last-child {
    margin-bottom: 0;
}

.legend-indicator-box {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* === MODALS === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #1c1c22;
    border: 1px solid #c8aa6e;
    border-radius: 6px;
    width: 90%;
    max-width: 500px;
    max-height: 80%;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    text-align: left;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3c3c41;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.modal-header h2 {
    margin: 0;
    color: #f0e6d2;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: #ffffff;
}

/* === STATS === */
.stats-banner {
    display: flex;
    justify-content: space-around;
    background: #1a1a1f;
    border: 1px solid #3c3c41;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    width: 100%;
    font-size: 13px;
}

.stat-box {
    text-align: center;
}

.stat-val {
    display: block;
    font-size: 18px;
    color: #c8aa6e;
    font-weight: bold;
    margin-top: 2px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 20px 0;
    text-align: center;
}

.stats-card {
    background-color: #121214;
    border: 1px solid #3c3c41;
    border-radius: 4px;
    padding: 12px 4px;
}

.stats-number {
    font-size: 22px;
    font-weight: bold;
    color: #c8aa6e;
    display: block;
}

.stats-label {
    font-size: 10px;
    color: #a0a0a0;
    margin-top: 4px;
    display: block;
    text-transform: uppercase;
    font-weight: 600;
}

/* === SETTINGS === */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #3c3c41;
}

.setting-label {
    font-size: 14px;
    color: #e0e0e0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3c3c41;
    transition: 0.3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #c8aa6e;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* === SHARE SECTION === */
#shareSection {
    border-top: 1px solid #3c3c41;
    padding-top: 15px;
    margin-top: 15px;
    display: none;
}

#shareSection h3 {
    color: #4bb543;
    margin: 0 0 8px 0;
    font-size: 15px;
}

#sharePreview {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    color: #a0a0a0;
    background: #121214;
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
    margin: 5px 0 15px 0;
    border: 1px solid #2a2a30;
    line-height: 1.4;
}

.share-action-btn {
    background: #1c773e;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
    box-sizing: border-box;
    margin-top: 15px;
}

.share-action-btn:hover {
    background: #24924f;
}

/* === PATCH NOTES === */
.patch-version {
    color: #c8aa6e;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 15px;
}

.patch-list {
    margin: 0;
    padding-left: 20px;
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.5;
}

/* === DEV PANEL === */
.dev-panel {
    background-color: #1c1c22;
    border: 1px dashed #c8aa6e;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
    justify-content: space-around;
    align-items: center;
}

/* === MESSAGES === */
.win-message {
    color: #4bb543;
    font-size: 24px;
    font-weight: bold;
    margin-top: 20px;
    display: none;
}

.loading {
    font-size: 18px;
    color: #c8aa6e;
}

/* === FOOTER === */
.legal-footer {
    max-width: 800px;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.5;
    margin-top: 50px;
    padding: 15px 0;
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.legal-footer a {
    color: #c8aa6e;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* === MODE-SPECIFIC === */
.streak-disclaimer {
    color: #a0a0a0;
    font-size: 11px;
    font-style: italic;
    margin-top: -10px;
    margin-bottom: 15px;
    text-align: center;
}

.infinite-controls-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.game-btn {
    flex: 1;
}


#dailyShareBtn {
    margin-top: 15px;
}

.user-count-display {
    text-align: center;
    color: #a0a0a0;
    font-size: 12px;
    margin-top: 10px;
    padding: 8px;
    background: #1c1c22;
    border-radius: 4px;
    border: 1px solid #3c3c41;
}

#userCountNumber {
    color: #c8aa6e;
    font-weight: bold;
}

.suggestion-item.highlighted {
    background-color: #3c3c41;
    outline: 1px solid #c8aa6e;
}

/* Tier badge */
.tier-badge {
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(200, 170, 110, 0.2);
    color: #c8aa6e;
    font-weight: bold;
}

/* Max height for suggestion list */
#suggestionsContainer {
    max-height: 400px;
    overflow-y: auto;
}

