body {
    color: white;
    background: black;
    font-family: monaco, Verdana, monospace;

    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

h1, .cont, #subtitle {
    text-align: center;
}

a {
    color: gray;
}

/* --- Flag trainer layout / colors --- */

#game {
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    margin: 20px 0;
    background-color: black;
    color: white;
}

/* header row: modes + stats */

#mode-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.mode-label {
    color: #aaa;
    font-size: 0.85rem;
}

.mode-button {
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #555;
    background: #000;
    color: #eee;
    font-size: 1rem;
    cursor: pointer;
}

.mode-button.active-mode {
    border-color: #aaa;
    background: #111;
}

#streak-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: #bbb;
    margin-bottom: 2px;
}

#stats-and-flag {
    position: relative;
    margin: 20px 0;
    align-items: flex-end;
}

#stats-block {
    display: flex;
    flex-direction: column;
    text-align: left;
    position: absolute;
    left: 0;
    bottom: 0;
}

/* flag area */

#flag-container {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    bottom: 2px;

    width: 320px;
    max-width: 100%;
    aspect-ratio: 3 / 2;      /* default; overridden in JS */
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #444;
    background: #000;
}

#flag-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: fill;         /* fill the ratio */

    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
}

/* 3x3 cover tiles */

#flag-cover {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    pointer-events: none;
}

.cover-tile {
    background: #111;
    border: 1px solid #222;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.2s ease-out;
}

.cover-tile.revealed {
    opacity: 0;
}

/* input + buttons */

#controls {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

#guess-input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid #555;
    background: #000;
    color: #fff;
    font-size: 1rem;
    font-family: monaco;
}

button {
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #555;
    background: #000;
    color: #eee;
    font-size: 1rem;
    font-family: monaco;
    cursor: pointer;
}

button:hover:not(:disabled) {
    background: #111;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

#message {
    min-height: 1.2em;
    margin-bottom: 4px;
    font-size: 1rem;
}

#guesses {
    list-style: none;
    padding-left: 0;
    margin: 4px 0 0 0;
    font-size: 1rem;
    border-top: 1px dotted #333;
}

#guesses li {
    padding: 2px 0;
    border-bottom: 1px dotted #333;
}

#meta-hints {
    margin-top: 4px;
    font-size: 1rem;
    color: #bbb;
}
