:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-text: #e0e0e0;
    --secondary-text: #a0a0a0;
    --border-color: #444;
    --correct-color: #4caf50;
    --partial-color: #ffc107;
    --incorrect-color: #f44336;
    --accent-color: #6a1b9a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-text);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding-top: 20px;
}

#game-container {
    width: 100%;
    max-width: 1800px;
    padding: 20px;
    box-sizing: border-box;
}

header {
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0 15px;
}

header h1 {
    color: var(--accent-color);
    margin: 0;
}

header p {
    width: 100%;
    margin-top: 5px;
    margin-bottom: 0;
}

.hint-button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.9em;
    font-weight: bold;
    color: var(--secondary-text);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.hint-button:hover {
    background-color: var(--border-color);
    color: var(--primary-text);
}


.hidden {
    display: none !important;
}

#loading {
    text-align: center;
    padding: 40px;
}
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#input-container {
    position: relative;
}

#vn-input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--primary-text);
    box-sizing: border-box;
}

#search-results {
    list-style: none;
    padding: 0;
    margin: 5px 0 0;
    position: absolute;
    width: 100%;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

#search-results li {
    padding: 10px;
    cursor: pointer;
}

#search-results li:hover {
    background-color: var(--accent-color);
}

#guesses-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.guess-row {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
}

.guess-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0 0 10px;
}

.guess-content-wrapper {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

/* NEW: Wrapper for the date and developer info */
.info-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.release-date-indicator {
    flex-shrink: 0;
    width: 60px;
    padding: 10px;
    background-color: var(--bg-color);
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.release-date-indicator .arrow {
    font-size: 1.5em;
    display: block;
    line-height: 1;
}

.release-date-indicator .date {
    font-size: 1em;
    font-weight: normal;
    color: var(--secondary-text);
    margin-top: 5px;
    display: block;
}

.developer-indicator {
    flex-shrink: 0;
    width: 100px;
    padding: 10px;
    background-color: var(--bg-color);
    color: var(--secondary-text);
    border-radius: 5px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
}

.developer-indicator.correct {
    background-color: var(--correct-color);
    color: #fff;
}

.developer-indicator.incorrect {
    background-color: var(--incorrect-color);
    color: #fff;
}

.tags-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-grow: 1;
    transition: max-height 0.4s ease-in-out;
    min-width: 0;
}

.tags-column {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
}

.guess-row.collapsible {
    cursor: pointer;
}

.tags-container.collapsed {
    max-height: 75px;
    overflow: hidden;
    position: relative;
}

.tags-container.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--surface-color));
    pointer-events: none;
}

.tag {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-correct { background-color: var(--correct-color); }
.tag-partial { background-color: var(--partial-color); }
.tag-incorrect { background-color: var(--incorrect-color); }

#win-screen {
    text-align: center;
    padding: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-top: 20px;
}

#share-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}

#share-button:hover {
    opacity: 0.9;
}

#share-text {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-color);
    color: var(--secondary-text);
    border: 1px solid var(--border-color);
    padding: 10px;
    resize: none;
    height: 340px;
}

/* --- START: MOBILE RESPONSIVE FIX --- */
@media (max-width: 768px) {
    .guess-content-wrapper {
        flex-direction: column; /* Stacks .info-row and .tags-container */
    }

    .info-row {
        width: 100%; /* Ensure the row takes full width */
    }

    /* Make date and dev indicators share the space equally */
    .release-date-indicator,
    .developer-indicator {
        flex: 1; /* This overrides the fixed widths */
        width: auto;
    }

    .tags-container {
        flex-direction: column;
    }
}
/* --- END: MOBILE RESPONSIVE FIX --- */