* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Metin seçimini engelleme (Oyunlarda genel pratik) */
    user-select: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #222;
    /* Piksel sanat fontunu ayarla - index.html'den çekilir */
    font-family: 'Press Start 2P', cursive;
}

#game-container {
    width: 800px;
    height: 600px;
    position: relative;
    overflow: hidden;
    touch-action: none; /* Mobilde kaydırma/yakınlaştırmanın oyunu bozmasını engeller */
    /* Eski tarz oyun veya piksel hissini güçlendirmek için bir gölge / kenarlık ekleyelim */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 255, 255, 0.1);
    border: 4px solid #fff;
    border-radius: 4px;
    background-color: #000;
}

canvas {
    display: block;
    /* Piksel sanat görüntülerini keskin tutar */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#auth-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
}

#auth-title {
    font-size: 30px;
    color: #ffd700;
    margin-bottom: 40px;
    text-shadow: 4px 4px #000;
}

#login-form, #register-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 350px;
}

input {
    padding: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    background: #333;
    border: 4px solid #fff;
    color: white;
    outline: none;
    text-align: center;
}

input:focus {
    border-color: #ffd700;
}

button {
    padding: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 12px;
    background: #33aa33;
    border: 4px solid #fff;
    color: white;
    cursor: pointer;
    transition: transform 0.1s;
}

button:hover {
    background: #44cc44;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

p {
    font-size: 8px;
    margin-top: 15px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

p:hover {
    color: white;
    text-decoration: underline;
}

#logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
    padding: 10px;
    font-size: 8px;
    background: #ff4444;
}

#logout-btn:hover {
    background: #ff6666;
}

#friends-btn {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 50;
    padding: 10px;
    font-size: 8px;
    background: #3388ff;
}

#wheel-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 50;
    padding: 10px;
    font-size: 8px;
    background: #ffcc00;
    color: #333;
}

#settings-btn {
    position: absolute;
    top: 70px;
    left: 20px;
    z-index: 50;
    padding: 10px;
    font-size: 8px;
    background: #888;
}

#mailbox-btn {
    position: absolute;
    top: 120px;
    right: 20px;
    z-index: 50;
    padding: 10px;
    font-size: 8px;
    background: #ff4444;
}

#friends-modal, #wheel-modal, #settings-modal, #mailbox-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
}

#friends-content, #wheel-content, #settings-content, #mailbox-content {
    background: #222;
    border: 6px solid #fff;
    padding: 30px;
    width: 500px;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    text-align: center;
    color: white;
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
    color: #ff4444;
}

#wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
}

#wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ff4444;
    z-index: 10;
}

#spin-btn {
    margin-top: 20px;
    width: 200px;
}

#wheel-timer {
    font-size: 10px;
    color: #ffd700;
    margin-top: 10px;
}

.setting-item {
    margin: 30px 0;
}

.setting-item label {
    font-size: 12px;
    margin-right: 10px;
}

select {
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    background: #333;
    color: white;
    border: 3px solid #fff;
    font-size: 10px;
}

#mailbox-content {
    background: #333;
    border: 5px solid #fff;
    padding: 20px;
    width: 400px;
    text-align: center;
    color: white;
}

.mail-item {
    border-bottom: 2px solid #555;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
}

.accept-btn { background: #4caf50; padding: 5px; cursor: pointer; }
.reject-btn { background: #f44336; padding: 5px; cursor: pointer; }

/* Multiplayer Mode Style */
#multiplayer-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 500;
    display: flex;
    flex-direction: column;
}

#multi-header {
    height: 100px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: #ffd700;
    font-size: 20px;
    border-bottom: 4px solid white;
}

#canvases-container {
    display: flex;
    flex: 1;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #444;
    position: relative;
    padding-top: 20px;
}

.canvas-wrapper span {
    color: white;
    margin-bottom: 5px;
    font-size: 12px;
}

#my-canvas-box, #opp-canvas-box {
    width: 400px;
    height: 450px;
}

/* 400x600'lük oyun canvasları split-screen kutusuna sığdırılır */
#my-canvas-box canvas, #opp-canvas-box canvas {
    width: 100%;
    height: 100%;
}

.friend-item button {
    padding: 5px 8px;
    font-size: 6px;
    background: #ff8800;
}

#vs-text {
    font-size: 40px;
    color: white;
    text-shadow: 2px 2px #ff0000;
}

#friends-content h2 {
    color: #ffd700;
    font-size: 15px;
    margin-bottom: 20px;
}

#add-friend-box {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

#add-friend-box input {
    flex: 1;
    font-size: 8px;
}

#add-friend-box button {
    font-size: 8px;
    padding: 10px;
}

#pending-requests, #friends-container {
    padding: 10px;
    background: #111;
    margin-top: 10px;
    font-size: 8px;
}

.request-item, .friend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid #333;
}

.request-item button {
    padding: 5px;
    font-size: 6px;
    background: #33aa33;
    margin-left: 5px;
}

.request-item button.reject {
    background: #ff4444;
}

h3 {
    font-size: 10px;
    color: #888;
    margin-top: 15px;
}
