:root {
    --cell-size: 60px;
    --primary-color: #4a90e2;
    --background-color: #000;
    --border-color: #dcdde1;
    /* Define base colors (darker, less saturated) */
    --color-1: rgb(180, 50, 80);    /* darkened red */
    --color-2: rgb(30, 90, 160);    /* darkened blue */
    --color-3: rgb(180, 150, 40);   /* darkened yellow */
    --color-4: rgb(30, 120, 120);   /* darkened teal */
    --color-5: rgb(90, 60, 160);    /* darkened purple */
    --color-6: rgb(180, 100, 30);   /* darkened orange */
    --color-7: rgb(120, 120, 120);  /* darkened gray */
    /* Segment colors (solid, no transparency) */
    --segment-1-color: var(--color-1);
    --segment-2-color: var(--color-2);
    --segment-3-color: var(--color-3);
    --segment-4-color: var(--color-4);
    --segment-5-color: var(--color-5);
    --segment-6-color: var(--color-6);
    --segment-7-color: var(--color-7);
    /* Line colors (using the same base colors) */
    --segment-1-line: var(--color-1);
    --segment-2-line: var(--color-2);
    --segment-3-line: var(--color-3);
    --segment-4-line: var(--color-4);
    --segment-5-line: var(--color-5);
    --segment-6-line: var(--color-6);
    --segment-7-line: var(--color-7);
}

/* Mobile-specific variables */
@media (max-width: 767px) {
    :root {
        --cell-size: 45px; /* Larger cells for mobile */
    }

    .game-container {
        width: 100vw;
        max-width: 100vw;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        overflow-x: visible;
        background: none;
    }

    .header {
        flex-direction: column;
        align-items: center;
    }
    
    .controls {
        justify-content: center;
        width: 100%;
    }
}

/* Very small screens */
@media (max-width: 374px) {
    :root {
        --cell-size: 38px; /* Even smaller cells for very small screens */
    }
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    box-sizing: border-box;
    touch-action: manipulation; /* Prevents double-tap zoom */
    -webkit-touch-callout: none; /* Prevents callout to copy image, etc when tap to hold */
    -webkit-tap-highlight-color: transparent; /* Removes tap highlight color */
    -ms-touch-action: manipulation; /* For IE/Edge */
    touch-action: pan-x pan-y; /* Only allow panning, no zoom */
    overscroll-behavior: none; /* Prevents bounce/overscroll effects */
}

html {
    touch-action: manipulation; /* Prevents double-tap zoom */
    -ms-touch-action: manipulation; /* For IE/Edge */
    touch-action: pan-x pan-y; /* Only allow panning, no zoom */
    overscroll-behavior: none; /* Prevents bounce/overscroll effects */
}

.game-container {
    background-color: #181818;
    color: #fff;
    padding: 0px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    touch-action: pan-x pan-y;
    overscroll-behavior: none;
}

.header {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 14px;
}

@media (max-width: 767px) {
    button {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .header {
        flex-direction: column;
        align-items: center;
    }
    
    .controls {
        justify-content: center;
        width: 100%;
    }
}

button:hover {
    opacity: 0.9;
}

/* Active state for Notes toggle button */
button.active {
    background-color: #2ecc71;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(7, var(--cell-size));
    gap: 4px;
    padding: 0px;
    position: relative;
    margin: 0 auto;
    max-width: 90%;
    overflow-x: hidden;
    touch-action: none; /* Prevents all touch actions except scrolling */
    user-select: none;
    justify-content: center;
    padding-left: calc(var(--cell-size) / 2);
    padding-right: calc(var(--cell-size) / 2);
}

.cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    background-color: white;
    position: relative;
    z-index: 1;
    touch-action: none;
}

@media (max-width: 767px) {
    .cell {
        font-size: 24px;
    }
}

@media (max-width: 374px) {
    .cell {
        font-size: 20px;
    }
}

/* Fill cells with segment colors */
.cell[data-segment="1"] { background-color: var(--segment-1-color); }
.cell[data-segment="2"] { background-color: var(--segment-2-color); }
.cell[data-segment="3"] { background-color: var(--segment-3-color); }
.cell[data-segment="4"] { background-color: var(--segment-4-color); }
.cell[data-segment="5"] { background-color: var(--segment-5-color); }
.cell[data-segment="6"] { background-color: var(--segment-6-color); }
.cell[data-segment="7"] { background-color: var(--segment-7-color); }

.cell:hover {
    filter: brightness(0.95);
}

.cell.selected {
    outline: 3px solid #fff;
    outline-offset: -3px;
    filter: brightness(0.9);
}

.cell.error {
    border-color: #e74c3c !important;
    color: #e74c3c;
}

.number-controls {
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    gap: 10px;
}

.numbers {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;  /* Prevent wrapping */
    background-color: #222;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: fit-content;  /* Ensure container fits all buttons */
}

.notes-numbers {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: nowrap;
    background-color: #222;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: fit-content;
}

.number, .note-number {
    width: 40px;  /* Slightly smaller to fit in one row */
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    font-weight: bold;
    background-color: #333;
    border: 2px solid #444;
    transition: all 0.2s ease;
    flex-shrink: 0;  /* Prevent buttons from shrinking */
}

.note-number {
    background-color: #444;
    border: 2px solid #555;
    font-size: 16px;
    color: #aaa;
}

.number:hover, .note-number:hover {
    background-color: #444;
    transform: scale(1.05);
}

.note-number:hover {
    background-color: #555;
}

@media (max-width: 767px) {
    .number, .note-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .note-number {
        font-size: 14px;
    }
    
    .numbers, .notes-numbers {
        gap: 6px;
        padding: 12px;
    }
}

@media (max-width: 374px) {
    .number, .note-number {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .note-number {
        font-size: 12px;
    }
    
    .numbers, .notes-numbers {
        gap: 4px;
        padding: 10px;
    }
}

.segment-connection {
    position: absolute;
    z-index: 0;
    opacity: 1;
    transform-origin: 0 50%;
    pointer-events: none;
    border-radius: 2px;
}

/* Notes styling */
.notes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 75%;  /* Reduced from 85% to give more margin from cell border */
    height: 75%; /* Reduced from 85% to give more margin from cell border */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    gap: 1px;  /* Reduced from 2px to make notes more compact */
    pointer-events: none;
}

.note {
    min-height: 12px;  /* Reduced from 14px */
    font-size: 11px;   /* Reduced from 12px */
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    padding: 1px;  /* Added small padding */
}

@media (max-width: 767px) {
    .note {
        min-height: 9px;   /* Reduced from 10px */
        font-size: 9px;    /* Reduced from 10px */
    }
}

@media (max-width: 374px) {
    .note {
        min-height: 8px;   /* Reduced from previous size */
        font-size: 8px;    /* Reduced from previous size */
    }
}

/* Only display numbers for active notes */
.note.active {
    font-weight: bold;
}

/* Fixed positions for each number */
.note-1 {
    grid-row: 1;
    grid-column: 1;
}

.note-2 {
    grid-row: 1;
    grid-column: 2;
}

.note-3 {
    grid-row: 1;
    grid-column: 3;
}

.note-4 {
    grid-row: 2;
    grid-column: 1;
}

.note-5 {
    grid-row: 2;
    grid-column: 2;
}

.note-6 {
    grid-row: 2;
    grid-column: 3;
}

.note-7 {
    grid-row: 3;
    grid-column: 2;
}

/* Version info styling */
.version-info {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 20px;
    margin-bottom: 10px;
}

.message-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background-color: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    cursor: pointer;
    user-select: none;
}

.message-container:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.message-container.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.message-content {
    margin-bottom: 8px;
}

.dismiss-hint {
    font-size: 14px;
    opacity: 0.8;
    font-weight: normal;
    font-style: italic;
}

@media (max-width: 767px) {
    .message-container {
        font-size: 20px;
        padding: 15px 30px;
    }
    
    .dismiss-hint {
        font-size: 12px;
    }
}

.board-number {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 10;
}

.board-number:hover {
    color: #999;
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 767px) {
    .board-number {
        font-size: 11px;
        bottom: 3px;
        right: 8px;
    }
} 