@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;700&display=swap');

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 2em 1em;
    font-family: 'Fredoka', 'Trebuchet MS', sans-serif;
    background:
        repeating-linear-gradient(
            100deg,
            rgba(255,255,255,0.08) 0px,
            rgba(255,255,255,0.08) 5px,
            transparent 5px,
            transparent 70px
        ),
        linear-gradient(200deg, #c31730 0%, #8a0f22 45%, #2a0510 100%);
    color: #eaf6ff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.console {
    width: 100%;
    max-width: 640px;
}

/* Top screen - logo + nav, like the DS's upper display */
.screen-top {
    position: relative;
    background: linear-gradient(160deg, #0c1a4a 0%, #071033 45%, #050b24 100%);
    border-radius: 18px;
    padding: 1.2em 1.5em;
    box-shadow:
        0 0 0 4px #1a2a6c,
        0 0 0 7px #0a1338,
        0 10px 30px rgba(0,0,0,0.6);
}

.player-badge {
    position: absolute;
    top: 0.7em;
    left: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.4em;
    font-weight: 700;
    font-size: 0.85em;
}
.player-badge img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* The hinge between the two screens */
.hinge {
    height: 18px;
    margin: 6px auto;
    width: 70%;
    background: linear-gradient(180deg, #1a1e2e, #0a0c14);
    border-radius: 6px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

/* Bottom screen - page content, like the DS's touch screen */
.screen-bottom {
    background: linear-gradient(160deg, #0c1a4a 0%, #071033 45%, #050b24 100%);
    border-radius: 18px;
    padding: 1.5em 1.5em 2em;
    box-shadow:
        0 0 0 4px #1a2a6c,
        0 0 0 7px #0a1338,
        0 10px 30px rgba(0,0,0,0.6);
}

.logo {
    text-align: center;
    font-weight: 700;
    font-size: 1.8em;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 0 #0a4d8c, 0 4px 6px rgba(0,0,0,0.5);
    margin: 0.2em 0 0.6em;
}
.logo span { color: #6fe6a0; }

nav {
    display: flex;
    justify-content: center;
    gap: 0.6em;
    flex-wrap: wrap;
}
nav a {
    background: linear-gradient(180deg, #ffe37a, #e0a92a);
    border: 2px solid #7a5710;
    color: #3a2a05;
    font-weight: 700;
    text-decoration: none;
    padding: 0.5em 1em;
    border-radius: 5px;
    font-size: 0.85em;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
nav a:hover { filter: brightness(1.08); }

.panel {
    background: rgba(6, 20, 60, 0.75);
    border: 2px solid #2a4fa0;
    border-radius: 12px;
    padding: 1.2em 1.4em;
    margin-bottom: 1em;
}

h1, h2 {
    font-weight: 700;
    color: #ffe37a;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-top: 0;
}
h1 { font-size: 1.4em; }
h2 { font-size: 1.15em; }

.game-heading {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.game-heading img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

p { line-height: 1.5; }

a { color: #8fd6ff; }

.warning {
    background: rgba(200, 60, 40, 0.25);
    border: 2px solid #d85a3f;
    border-radius: 10px;
    padding: 0.8em 1em;
    color: #ffd7cc;
}

.passphrase {
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: 2px;
    color: #6fe6a0;
    text-align: center;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 0.4em;
    margin: 0.6em 0;
}

.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 0.5em;
    margin: 0.5em 0 1em;
}
.icon-choice {
    display: block;
    margin: 0;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 0.2em;
}
.icon-choice input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.icon-choice img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}
.icon-choice:has(input:checked) {
    border-color: #ffe37a;
    background: rgba(255,227,122,0.15);
}

form label {
    display: block;
    margin-bottom: 0.8em;
    font-size: 0.9em;
}

.guide-shot {
    display: block;
    max-width: 240px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 2px solid #a02b3a;
    margin: 0.5em 0 1em;
}
input[type=text], input[type=email], input[type=password] {
    display: block;
    width: 100%;
    margin-top: 0.3em;
    padding: 0.5em 0.7em;
    border-radius: 8px;
    border: 2px solid #2a4fa0;
    background: #0a1638;
    color: #eaf6ff;
    font-family: inherit;
    font-size: 1em;
}

button, .btn {
    background: linear-gradient(180deg, #ffe37a, #e0a92a);
    border: 2px solid #7a5710;
    color: #3a2a05;
    font-weight: 700;
    font-family: inherit;
    padding: 0.6em 1.4em;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
button:hover, .btn:hover { filter: brightness(1.08); }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}
tr {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
th, td {
    text-align: left;
    padding: 0.4em 0.5em;
    vertical-align: middle;
}
th { color: #8fd6ff; font-weight: 700; }
tr:first-child td { color: #ffe37a; font-weight: 700; } /* highlight #1 */

.player-cell {
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.player-cell img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

.table-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 0.7em;
}
.activity-item {
    display: flex;
    align-items: center;
    gap: 0.6em;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 0.5em 0.7em;
}
.activity-item > img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}
.activity-text {
    font-size: 0.9em;
    line-height: 1.5;
}
.inline-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin: 0 0.1em;
}
.activity-date {
    display: block;
    font-size: 0.8em;
    opacity: 0.6;
}

.category-row {
    display: flex;
    gap: 0.5em;
    margin-bottom: 0.8em;
}
.category-btn {
    flex: 1;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0.3em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.category-btn:hover {
    filter: brightness(1.2);
}
.category-btn img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.game-scroll-wrap {
    display: flex;
    align-items: stretch;
    gap: 0.5em;
}
.game-grid {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 0.6em;
    min-width: 0; /* lets flexbox actually shrink this instead of overflowing the page */
}
.game-grid::-webkit-scrollbar { display: none; }
.game-grid a {
    flex: 0 0 calc((100% - 4 * 0.6em) / 5);
    scroll-snap-align: start;
    background: rgba(255,255,255,0.08);
    border: 1px solid #2a4fa0;
    border-radius: 5px;
    padding: 0.6em 0.4em;
    text-decoration: none;
    color: #eaf6ff;
    font-size: 0.8em;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4em;
}
.game-grid a img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}
.game-grid a.active {
    background: linear-gradient(180deg, #ffe37a, #e0a92a);
    color: #3a2a05;
    border-color: #7a5710;
    font-weight: 700;
    border-radius: 5px;
}

.scroll-arrow {
    flex: 0 0 auto;
    width: 2.2em;
    background: linear-gradient(180deg, #ffe37a, #e0a92a);
    border: 2px solid #7a5710;
    color: #3a2a05;
    font-weight: 700;
    font-size: 1.1em;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}
.scroll-arrow:hover { filter: brightness(1.08); }

.scroll-hint {
    display: none;
    text-align: center;
    font-size: 0.8em;
    opacity: 0.7;
    margin: 0.5em 0 0;
}

@media (max-width: 480px) {
    body { padding: 1em 0.5em; }
    .screen-top, .screen-bottom { padding: 1em; }
    .panel { padding: 1em; }
    .category-row { gap: 0.2em; }
    .category-btn img { width: 44px; height: 44px; }
    .scroll-arrow { display: none; }
    .scroll-hint { display: block; }
}

.error { color: #ff9d8a; }