
@import url('https://fonts.googleapis.com/css2?family=League+Spartan:wght@100..900&display=swap');


* {
    box-sizing: border-box;
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #45B7AF;
    --background-color: #F5F7FA;
    --admin-color: #005323;
    --danger-color: #ff6685;
    --text-color: #2C3E50;
    --grid-size: min(80vw, 600px);

    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-blue-100: #dbeafe;
    --color-blue-300: #93c5fd;
    --color-blue-500: #3b82f6;
    --color-blue-600: #2563eb;
    --color-blue-700: #1d4ed8;
    --color-blue-800: #1e40af;
    --color-blue-900: #1a3d7d;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Scroll shadows */
    --shadow-offset: 10px;
    --shadow-reset: 8px;
    --shadow-color: rgba(0,0,0,0.25);
    --top-shadow: inset 0px var(--shadow-offset) var(--shadow-reset) calc(-1*var(--shadow-reset)) var(--shadow-color);
    --bottom-shadow: inset 0px calc(-1*var(--shadow-offset)) var(--shadow-reset) calc(-1*var(--shadow-reset)) var(--shadow-color);
}

body {
    font-family: 'League Spartan','Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 2px;
    background: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    margin-top: 20px;
    padding: 2px;
    position: relative;
}

.game-header {
    text-align: center;
    position: relative;
    width: var(--grid-size);
    margin: 0 auto 2px auto;
}

.game-header h1 {
    margin-top: 5px;
}

.player-info {
    font-size: 1.2em;
    margin-bottom: 5px;
}

#share-button {
    position: absolute;
    bottom: 0;
    right: 5px;
    margin: 5px 5px 0 0;
}

#about-button {
    position: absolute;
    bottom: 0;
    left: 5px;
}

#abandon-board-button {

    margin: 5px 5px 5px 0;
}

#qr-code {
    text-align: center;
}

/* Game board styling */

.bingo-board {
    display: grid;
    gap: 8px;
    width: var(--grid-size);
    height: var(--grid-size);
    margin: 0 auto;
    padding: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.board-4x4 {
    grid-template-columns: repeat(4, 1fr);
}

.board-5x5 {
    grid-template-columns: repeat(5, 1fr);
}

.bingo-cell {
    aspect-ratio: 1;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px;
    font-size: 3vw;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    user-select: none;
    overflow: hidden;
}

.bingo-cell.covered {
    background: var(--primary-color);
    color: white;
}

.bingo-cell.free {
    background: var(--secondary-color);
    color: white;
    font-weight: bold;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: var(--grid-size);
    position: relative;
}

.modal-content h2 {
    text-align: center;
}

/* BUTTONS */
.button {
    padding: 0.65em 1em;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.is-primary {
    background: var(--primary-color);
    color: white;
}

.is-secondary {
    background: var(--secondary-color);
    color: white;
} 

.is-danger {
    background: var(--danger-color);
}

.is-small {
    margin: 0;
    padding: 0.5em 0.8em;
    font-size: 0.8em;
}

.is-admin {
    background: var(--admin-color);
    color: white;
}

/* FORMS */
button.form-control, .field {
    margin-top: 1rem;
}

.field {
    text-align: left;
}

.field label {
    font-weight: bold;
}

.field input[type="text"] {
    width: 100%;
    padding: 0.5em;
}

.field .help {
    font-size: 0.9rem;
}

.suggestion-input {
    width: 100%;
}

.textarea {
    width: 100%;
    padding: 0.5em;
}

/* MESSAGES */
.game-events {
    width: var(--grid-size);
    margin: 20px auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.events-list {
    max-height: 300px;
    overflow-y: auto;
}

.event-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-item.winning-message {
  font-size: 1.3em;
  animation: wiggle 1s 15;
}

@keyframes throb {
  0% {
      transform: scale(0.9);
    }
  50% {
      transform: scale(1.1);
    }
  100% {
      transform: scale(0.9);
    }
}

@keyframes wiggle {
  0% {
      transform: rotate(2deg);
    }
  50% {
      transform: rotate(-2deg);
    }
  100% {
      transform: rotate(2deg);
    }
  }
.event-time {
    color: #666;
    font-size: 0.8em;
}

.event-item:last-child {
    border-bottom: none;
}

/* MESSAGES: UNUSED */

.error-message {
    background: #fee;
    color: #c00;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    border-color: #c00;
}

.connected-players {
    margin: 10px 0;
}

.player-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    margin: 0 4px;
    font-size: 0.9em;
}

/* FOOTER */
.made-with-love {
    font-size: 0.8em;
    background-color: var(--background-color);
    margin: 0 auto;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    display: flex;
    align-items: center;
}

.made-with-love p {
  margin: 0 auto;
}

/* SIDEBAR STYLING */
.sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    top: 0;
    left: 0;
    z-index: 40;
    width: 16rem;
    width: 80vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding: 1rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    background-color: var(--color-white);
    border: 1px solid blue;
}

.sidebar-content {
    overflow-y: auto;
    flex-grow: 1;
}

.sidebar-content.top-shadow {
    box-shadow: var(--top-shadow);
}

.sidebar-content.bottom-shadow {
    box-shadow: var(--bottom-shadow);
}
.sidebar-content.bottom-shadow.top-shadow {
    box-shadow: var(--top-shadow), var(--bottom-shadow);
}

.sidebar-content div {
    margin-bottom: 5px;
}

#sidebar.show {
    transform: translateX(0);
    box-shadow: 48px 0px 32px var(--shadow-color);
}  

/* sidebar Menu Title */
.sidebar h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    color: var(--color-gray-500);
}

.sidebar-content h5 {
    margin-top: 2em;
    padding-top: 0.5em;
    border-top: 1px solid var(--color-gray-300)
}

/* Close Button */
.close-button {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    background-color: transparent;
    color: var(--color-gray-400);
    padding: 0.375rem;
    border-radius: 0.375rem;
    border: 0 solid;
    align-items: center;
    display: flex;
    margin: 0;
    padding: 6px;
    top: 10px;
    appearance: button;
}

.close-button > .svg-icon {
    height: 10px;
    width: 10px;
}

.close-button:hover {
    background-color: var(--color-gray-200);
    color: var(--color-gray-900);
}

/* SVG Icons */
.svg-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--color-gray-500);
    transition: fill 0.15s ease-in-out;
}

/* HOME PAGE STYLES */

details h1,
details h2,
details h3,
details h4,
details h5,
details h6 {
    display: inline;
}

.active-games-section {
    border: 8px solid var(--primary-color);
    background-color: var(--primary-color);
    padding: 0;
    margin: 1em 0;
}

.active-games-section h2 {
    width: 100%;
    color: white;
    padding: 0.5em;
    margin: 0;
}

.game-list {
    padding: 0.5em;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.game-card {
    margin: 1em;
    border: 2px solid var(--color-gray-500);
    border-radius: 0.5em;
    background-color: var(--color-white);
    padding: 0.5em 1em;
    flex-grow: 1;
}


@media (max-width: 600px) {
    :root {
        --grid-size: 95vw;
    }
    body {
        padding: 0px;
    }

    .container {
        padding: 1px;
    }

    .bingo-board {
        gap: 2px;
        padding: 2px;
    }

    .bingo-cell {
        padding: 2px;
        font-size: 1vw;
    }

    .sidebar {
        height: 100dvh;
        max-height: 100dvh;
    }
}
