@font-face {
    font-family: 'Comfortaa';
    src: url('../fonts/Comfortaa-Medium.ttf') format('truetype'),
    url('https://fonts.gstatic.com/s/comfortaa/v34/4UaGrENt0d7j0II9g7-JVCKQ7Q.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Comfortaa';
    src: url('../fonts/Comfortaa-SemiBold.ttf') format('truetype'),
    url('https://fonts.gstatic.com/s/comfortaa/v34/4UaGrENt0d7j0II9g7-JVCKQ7Q.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Comfortaa';
    src: url('../fonts/Comfortaa-Bold.ttf') format('truetype'),
    url('https://fonts.gstatic.com/s/comfortaa/v34/4UaGrENt0d7j0II9g7-JVCKQ7Q.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* CSS Variables for Dynamic Grid Sizing */
:root {
    --cell-size: 56px;
    --font-scale: 0.429;
    --text-stroke-scale: 0.018;
    --border-radius-scale: 0.143;
    --container-padding: 24px;
}

/* Text stroke utility classes */
.text-stroke-thick {
    -webkit-text-stroke: 2px currentColor;
    paint-order: stroke fill;
}

.text-stroke-medium {
    -webkit-text-stroke: 1px currentColor;
    paint-order: stroke fill;
}

.text-stroke-thin {
    -webkit-text-stroke: 0.5px currentColor;
    paint-order: stroke fill;
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.language-selector select {
    padding: 8px 30px 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    font-family: 'Comfortaa', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 120px;
}

.language-selector select:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
}

.language-selector select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom dropdown arrow */
.language-selector::after {
    content: '▼';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #374151;
    font-size: 0.7rem;
}

/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comfortaa', sans-serif;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 4px;
}

.header {
    text-align: center;
    margin-bottom: 32px;
    max-width: 600px;
    width: 100%;
}

h1 {
    color: #1f2937;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1;
}

.instructions {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
}

.instructions br {
    display: block;
    content: "";
    margin-top: 4px;
}

/* Old game-info section - hidden in new layout */
.game-info {
    display: none;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin-bottom: 24px;
    background: white;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.swap-counter {
    font-size: 1.125rem;
    color: #4b5563;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.swap-counter span {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Old header button styles */
.new-game-btn-header {
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.new-game-btn-header:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4), 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Background overlay to tone down the background image */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 1.0); /* Adjustable opacity - increase for more dimming */
    z-index: -1;
    pointer-events: none;
}

/* Disable text selection across the whole game */
body {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none;   /* Safari */
  -khtml-user-select: none;    /* Konqueror HTML */
  -moz-user-select: none;      /* Old versions of Firefox */
  -ms-user-select: none;       /* Internet Explorer/Edge */
  user-select: none;           /* Non-prefixed version, currently supported by Chrome, Edge, Opera and Firefox */
}

/* Optional: Keep inputs and textareas selectable if your game has them */
input, textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ===== REUSABLE FORM STYLES ===== */
/* Shared input and textarea styles for forms across the project */

input[type="text"],
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
    background: var(--color-surface-light);
    color: var(--color-text-primary);
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea {
    resize: vertical;
    line-height: 1.5;
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
}

/* Readonly inputs */
input[type="text"]:read-only {
    background: #f9fafb;
    color: var(--color-text-muted);
    cursor: default;
}
