* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.mode-info {
    font-size: 1.2em;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    background: #f0f0f0;
}

.mode-create {
    background: #ffd93d;
    color: #333;
}

.mode-play {
    background: #6bcf7f;
    color: white;
}

.size-control {
    display: flex;
    gap: 10px;
    align-items: center;
}

.size-control label {
    font-weight: bold;
}

.size-control input {
    width: 60px;
    padding: 5px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #667eea;
    color: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

@media (hover: hover) {
    button:hover {
        background: #5568d3;
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }
}

button:active {
    transform: translateY(0);
}

.game-board {
    display: grid;
    gap: 8px;
    margin: 20px auto;
    width: fit-content;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 15px;
}

.tile {
    aspect-ratio: 1;
    min-width: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 3px solid #ddd;
}

/* Only apply hover effect on devices that support hover */
@media (hover: hover) {
    .tile:hover {
        transform: scale(1.05);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
}

.tile:active {
    transform: scale(0.95);
}

.tile-create {
    background: linear-gradient(135deg, #ffd93d 0%, #ffb800 100%);
    color: #333;
}

.tile-play {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.tile-play.negative {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.game-over {
    text-align: center;
    padding: 20px;
    background: #ff6b6b;
    color: white;
    border-radius: 15px;
    margin-top: 20px;
}

.game-over h2 {
    margin-bottom: 15px;
    color: white;
}

.hidden {
    display: none;
}

.create-mode-panel {
    margin-top: 20px;
    padding: 20px;
    background: #ffd93d;
    border-radius: 15px;
}

.create-mode-panel h3 {
    margin-bottom: 15px;
    color: #333;
}

.url-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.url-container input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #333;
    border-radius: 8px;
    font-size: 0.9em;
    background: white;
}

.url-container a {
    text-decoration: none;
}

#copyUrlBtn {
    background: #4CAF50;
}

@media (hover: hover) {
    #copyUrlBtn:hover {
        background: #45a049;
    }
}

#copyUrlBtn.copied {
    background: #2196F3;
}

/* Mobile responsive styles */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        border-radius: 15px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .mode-info {
        font-size: 1em;
        text-align: center;
        padding: 8px 15px;
    }

    .size-control {
        justify-content: center;
        flex-wrap: wrap;
    }

    .size-control label {
        font-size: 0.9em;
    }

    .size-control input {
        width: 50px;
        padding: 4px;
    }

    button {
        padding: 8px 15px;
        font-size: 0.9em;
        width: 100%;
    }

    .game-board {
        padding: 10px;
        gap: 5px;
        max-width: 100%;
    }

    .tile {
        min-width: 45px;
        min-height: 45px;
        font-size: 1.2em;
        border: 2px solid #ddd;
    }

    .game-over {
        padding: 15px;
        margin-top: 15px;
    }

    .game-over h2 {
        font-size: 1.3em;
    }

    .create-mode-panel {
        padding: 15px;
        margin-top: 15px;
    }

    .create-mode-panel h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .url-container {
        flex-direction: column;
        align-items: stretch;
    }

    .url-container input {
        min-width: 100%;
        font-size: 0.8em;
        padding: 8px;
    }

    .url-container button {
        width: 100%;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.3em;
    }

    .tile {
        min-width: 40px;
        min-height: 40px;
        font-size: 1em;
    }

    .game-board {
        padding: 8px;
        gap: 4px;
    }
}
