@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600&display=swap');

:root {
    --bg-dark-space: #0b0c10;
    --bg-nebula: #1f2833;
    --primary-neon: #66fcf1;
    --secondary-neon: #45a29e;
    --text-light: #c5c6c7;
    --danger-glow: #ff4848;
    --success-glow: #70ff70;
    --font-title: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --card-width: clamp(120px, 15vw, 180px);
    --card-height: calc(var(--card-width) * 1.4);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark-space);
    background-image: 
        radial-gradient(circle at 15% 20%, var(--secondary-neon, #45a29e) 0%, transparent 30%),
        radial-gradient(circle at 85% 80%, var(--primary-neon, #66fcf1) 0%, transparent 30%);
    background-attachment: fixed;
    color: var(--text-light);
    min-height: 100vh;
    padding: 1rem;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* Top Controls Styling */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 2rem auto;
    padding: 0 1rem;
    z-index: 1001;
}

.wallet-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wallet-controls #userInfo {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    width: 100%;
    max-width: 1600px;
    gap: 2rem;
    align-items: flex-start;
    margin: 0 auto;
    flex: 1;
}

.side-panel {
    background: rgba(31, 40, 51, 0.4);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(102, 252, 241, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.side-panel h2 {
    font-family: var(--font-title);
    color: var(--secondary-neon);
    text-align: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--secondary-neon);
    padding-bottom: 0.5rem;
}

.history-cards-container, .tx-list-container {
    overflow-y: auto;
    padding-right: 10px; /* for scrollbar */
}

.history-cards-container .card-mini {
    width: 80px;
    height: calc(80px * 1.4);
    margin: 0 auto 10px;
}
.history-cards-container .card-mini img {
    width: 100%;
    border-radius: 5px;
}

.tx-list-container .tx-item {
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 5px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
}
.tx-item.win { border-left: 3px solid var(--success-glow); }
.tx-item.lose { border-left: 3px solid var(--danger-glow); }
.tx-item.nft { 
    border-left: 3px solid var(--primary-neon); 
    flex-direction: column;
    align-items: flex-start;
}
.tx-item-nft-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}
.tx-item-nft-info img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.container {
    width: 100%;
    padding: 2rem;
    background: rgba(31, 40, 51, 0.6);
    border-radius: 20px;
    border: 1px solid rgba(102, 252, 241, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 0 40px rgba(102, 252, 241, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--primary-neon);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 5px var(--primary-neon), 0 0 15px var(--primary-neon), 0 0 30px var(--primary-neon), 0 0 50px #fff;
    animation: flicker 3s infinite alternate;
    margin: 0;
}

/* Language Selector Styles */
.language-selector {
    position: relative;
}

.language-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.language-btn::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.language-btn.active::after {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(31, 40, 51, 0.95);
    border: 2px solid var(--primary-neon);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.3);
    z-index: 1002;
    min-width: 120px;
    margin-top: 5px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.language-dropdown.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.language-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-light);
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
    box-shadow: none;
    text-transform: none;
}

.language-option:first-child {
    border-radius: 6px 6px 0 0;
}

.language-option:last-child {
    border-radius: 0 0 6px 6px;
}

.language-option:hover {
    background: var(--primary-neon);
    color: var(--bg-dark-space);
    box-shadow: none;
}

.language-option.active {
    background: rgba(102, 252, 241, 0.2);
    color: var(--primary-neon);
}

@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { text-shadow: 0 0 4px var(--primary-neon), 0 0 11px var(--primary-neon), 0 0 19px var(--primary-neon), 0 0 40px var(--secondary-neon), 0 0 80px var(--secondary-neon); }
    20%, 24%, 55% { text-shadow: none; }
}

button, .stake-controls input {
    font-family: var(--font-title);
    background: transparent;
    color: var(--primary-neon);
    border: 2px solid var(--primary-neon);
    padding: 8px 16px; /* Küçültüldü */
    font-size: 0.9rem; /* Küçültüldü */
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 10px var(--primary-neon), inset 0 0 10px var(--primary-neon);
    border-radius: 8px;
    text-transform: uppercase;
    text-align: center;
}
button:hover, button.active {
    background: var(--primary-neon);
    color: var(--bg-dark-space);
    box-shadow: 0 0 25px var(--primary-neon), 0 0 50px var(--primary-neon);
}

.card-display-area {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 2rem;
}

.card-slot { text-align: center; }
.card-label { font-family: var(--font-body); font-size: 1rem; margin-bottom: 0.5rem; color: var(--secondary-neon); }

.card {
    width: var(--card-width);
    height: var(--card-height);
    position: relative;
    margin: 0 auto;
}
#previousCard img { width: 100%; border-radius: 15px; }

#nextCard {
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.4, 0.0, 0.2, 1);
}
#nextCard.flipped { transform: rotateY(180deg); }

#nextCard .card-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; }
#nextCard .card-front, #nextCard .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(197, 198, 199, 0.1);
    border: 1px solid rgba(102, 252, 241, 0.3);
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.2);
}
#nextCard .card-back { transform: rotateY(180deg); }
#nextCard img { width: 100%; height: 100%; object-fit: contain; border-radius: 15px; }

.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

#staking-area {
    background: rgba(0,0,0,0.25);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 1px solid var(--secondary-neon);
}
#staking-area h3 {
    font-family: var(--font-title);
    margin-bottom: 1rem;
}

/* Betting Controls - Game Area */
.betting-controls-game {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(102, 252, 241, 0.4);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.1);
}

.betting-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(102, 252, 241, 0.3);
}

.betting-title {
    font-family: var(--font-title);
    color: var(--primary-neon);
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 0 10px var(--primary-neon);
}

.bet-display-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(102, 252, 241, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 252, 241, 0.2);
}

.current-bet-info, .win-amount-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.bet-label, .win-label {
    font-family: var(--font-body);
    color: var(--secondary-neon);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.current-bet-amount, .potential-win-amount {
    font-family: var(--font-title);
    color: var(--primary-neon);
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 0 0 10px var(--primary-neon);
    background: rgba(102, 252, 241, 0.1);
    padding: 8px 12px;
    border-radius: 15px;
    border: 1px solid var(--primary-neon);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.2);
    min-width: 70px;
    text-align: center;
}

.bet-adjustment-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.bet-adjustment-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.bet-adjust-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s ease;
    background: transparent;
    border: 2px solid var(--primary-neon);
    color: var(--primary-neon);
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
    line-height: 1;
}

.bet-adjust-btn:hover:not(:disabled) {
    background: var(--primary-neon);
    color: var(--bg-dark-space);
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.6);
    transform: scale(1.1);
}

.bet-adjust-btn:disabled,
.bet-adjust-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--text-light);
    color: var(--text-light);
    box-shadow: none;
    transform: none;
}

.bet-adjustment-controls input {
    width: 80px;
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-light);
    border: 2px solid var(--primary-neon);
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.2), inset 0 0 10px rgba(102, 252, 241, 0.1);
    transition: all 0.3s ease;
}

.bet-adjustment-controls input:focus {
    outline: none;
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.4), inset 0 0 15px rgba(102, 252, 241, 0.2);
    border-color: var(--primary-neon);
}

.bet-adjustment-controls input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--text-light);
    box-shadow: 0 0 5px rgba(197, 198, 199, 0.3);
}

.bet-adjustment-controls input.invalid {
    border-color: var(--danger-glow);
    box-shadow: 0 0 15px rgba(255, 72, 72, 0.4), inset 0 0 10px rgba(255, 72, 72, 0.2);
}

.set-bet-btn {
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 8px;
    min-width: 80px;
    transition: all 0.3s ease;
}

.set-bet-btn:disabled,
.set-bet-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--text-light);
    color: var(--text-light);
    box-shadow: none;
}

.set-bet-btn:disabled:hover,
.set-bet-btn.disabled:hover {
    background: transparent;
    color: var(--text-light);
    box-shadow: none;
    transform: none;
}

.bet-status {
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(69, 162, 158, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(69, 162, 158, 0.3);
}

.bet-status span {
    color: var(--secondary-neon);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.bet-warning {
    background: rgba(255, 72, 72, 0.1);
    border: 1px solid var(--danger-glow);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-top: 0.5rem;
    animation: warningPulse 2s infinite;
}

.bet-warning span {
    color: var(--danger-glow);
    font-size: 0.85rem;
    font-weight: bold;
    display: block;
}

.bet-warning.hidden {
    display: none;
}

@keyframes warningPulse {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(255, 72, 72, 0.3);
    }
    50% { 
        box-shadow: 0 0 15px rgba(255, 72, 72, 0.6);
    }
}
.stake-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.stake-controls input {
    width: 120px;
    color: var(--text-light);
    border-color: var(--primary-neon); /* Butonlarla aynı renk */
    box-shadow: 0 0 10px var(--primary-neon), inset 0 0 10px var(--primary-neon); /* Butonlarla aynı gölge */
}

.stake-controls input:focus {
    outline: none;
    box-shadow: 0 0 15px var(--primary-neon), inset 0 0 15px var(--primary-neon);
    border-color: var(--primary-neon);
}
#gameBoard.hidden, #my-nft-section.hidden {
    display: none;
}

#my-nft-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--secondary-neon);
}

/* My NFT List */
.my-nft-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
}
.my-nft-item {
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}
.my-nft-item img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.nft-transfer-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nft-transfer-controls input {
    width: 100%;
    padding: 8px;
    background: var(--bg-dark-space);
    border: 1px solid var(--secondary-neon);
    color: var(--text-light);
    border-radius: 5px;
    font-size: 0.8rem;
}
.nft-transfer-controls button {
    padding: 8px 12px;
    font-size: 0.8rem;
}


#gas-info {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid var(--secondary-neon);
    text-align: center;
}

.session-address-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 1rem 0;
}

#session-wallet-address-input {
    flex-grow: 1;
    background: #0b0c10;
    border: 1px solid var(--secondary-neon);
    color: var(--text-light);
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    font-size: 0.8rem;
}

.faucet-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-neon);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px solid var(--primary-neon);
    transition: all 0.3s;
}

.faucet-link:hover {
    color: white;
    border-bottom-color: white;
}

#resultScreen, #nftBonusPopup {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(11, 12, 16, 0.9);
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    z-index: 100; 
    opacity: 1; 
    transition: opacity 0.5s;
}

#resultScreen.hidden, #nftBonusPopup.hidden {
    opacity: 0;
    pointer-events: none;
}

#resultMessage { font-family: var(--font-title); font-size: clamp(3rem, 12vw, 5rem); text-transform: uppercase; animation: result-pop 0.5s forwards; }
@keyframes result-pop { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#resultMessage.win { color: var(--success-glow); text-shadow: 0 0 20px var(--success-glow); }
#resultMessage.lose { color: var(--danger-glow); text-shadow: 0 0 20px var(--danger-glow); }

#nft-reward-display:not(.hidden) { display: block; text-align: center; margin-top: 1rem; }
#nft-reward-display img { max-width: 150px; border-radius: 10px; margin: 1rem 0; }

#playAgainBtn { margin-top: 2rem; }

.popup-content {
    padding: 40px;
    background: var(--bg-nebula);
    border: 2px solid var(--primary-neon);
    border-radius: 15px;
    box-shadow: 0 0 30px var(--primary-neon);
    text-align: center;
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#nftBonusPopup:not(.hidden) .popup-content {
    transform: scale(1);
}

.popup-content h2 {
    color: var(--primary-neon);
    margin-bottom: 1rem;
    font-family: var(--font-title);
}

/* Custom Popup System */
.custom-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.custom-popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.popup-container {
    position: relative;
    background: var(--bg-nebula);
    border: 2px solid var(--primary-neon);
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(102, 252, 241, 0.4);
    min-width: 320px;
    max-width: 500px;
    margin: 1rem;
    animation: popupSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes popupSlideIn {
    0% {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(102, 252, 241, 0.2);
}

.popup-header h3 {
    font-family: var(--font-title);
    color: var(--primary-neon);
    margin: 0;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.popup-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(102, 252, 241, 0.1);
    border: 1px solid var(--primary-neon);
}

.popup-icon.error {
    background: rgba(255, 72, 72, 0.1);
    border-color: var(--danger-glow);
}

.popup-icon.success {
    background: rgba(112, 255, 112, 0.1);
    border-color: var(--success-glow);
}

.popup-body {
    padding: 1rem 1.5rem;
}

.popup-body p {
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.popup-footer {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.popup-btn {
    font-family: var(--font-title);
    padding: 10px 20px;
    border: 2px solid var(--primary-neon);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-neon);
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    min-width: 100px;
}

.popup-btn:hover {
    background: var(--primary-neon);
    color: var(--bg-dark-space);
    box-shadow: 0 0 15px rgba(102, 252, 241, 0.5);
}

.popup-btn-primary {
    background: var(--primary-neon);
    color: var(--bg-dark-space);
    box-shadow: 0 0 10px rgba(102, 252, 241, 0.3);
}

.popup-btn-primary:hover {
    box-shadow: 0 0 20px rgba(102, 252, 241, 0.6);
    transform: translateY(-1px);
}

/* Tablet Uyumluluk */
@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .side-panel {
        height: auto;
        max-height: 250px;
        padding: 1rem;
    }
    #history-panel { order: 2; }
    .container { order: 1; }
    #tx-history-panel { order: 3; }
    
    .top-controls {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0 1rem;
    }
    
    .wallet-controls {
        justify-content: center;
    }
    
    header h1 {
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
    }
}

/* Mobil Cihazlar için Özel Tasarım */
@media (max-width: 600px) {
    /* Temel Layout */
    body { 
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    /* Ana Wrapper - Mobilde tek sütun */
    .main-wrapper {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-width: 100vw;
        margin: 0;
        padding: 0 0.5rem;
    }
    
    /* Side panelleri gizle - mobilde gereksiz */
    .side-panel {
        display: none;
    }
    
    /* Top Controls - Kompakt ve Yan Yana */
    .top-controls {
        position: sticky;
        top: 0;
        background: rgba(11, 12, 16, 0.95);
        backdrop-filter: blur(10px);
        z-index: 1000;
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 0 0 10px 10px;
        border: 1px solid rgba(102, 252, 241, 0.2);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
    }
    
    .language-selector {
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    .language-btn {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .language-dropdown {
        right: 0;
        left: auto;
        transform: none;
        min-width: 90px;
        margin-top: 2px;
    }
    
    .wallet-controls {
        flex-direction: column;
        gap: 0.2rem;
        align-items: flex-end;
        flex: 1;
        min-width: 0;
    }
    
    .wallet-controls button {
        padding: 6px 12px;
        font-size: 0.75rem;
        min-width: 100px;
        white-space: nowrap;
    }
    
    .wallet-controls #userInfo {
        font-size: 0.7rem;
        text-align: right;
        line-height: 1.2;
    }
    
    .wallet-controls #userInfo p {
        margin: 0.1rem 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    /* Ana Container - Mobil Optimized */
    .container {
        width: 100%;
        padding: 1rem 0.5rem;
        margin: 0;
        border-radius: 15px;
        min-height: auto;
    }
    
    /* Header - Kompakt */
    header {
        margin-bottom: 1rem;
    }
    
    header h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
        margin: 0;
        line-height: 1.2;
    }
    
    /* Kart Alanı - Mobil Optimized */
    .card-display-area { 
        gap: 0.8rem;
        margin-bottom: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    :root { 
        --card-width: clamp(90px, 30vw, 120px);
    }
    
    .card-slot {
        flex: 0 0 auto;
    }
    
    .card-label { 
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }
    
    /* Kontroller - Mobil Friendly */
    .controls { 
        gap: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .controls button {
        padding: 12px 20px;
        font-size: 1rem;
        font-weight: bold;
        border-radius: 25px;
        min-height: 50px;
        touch-action: manipulation;
    }
    
    /* Stake Area - Mobil Optimized */
    #staking-area {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }
    
    #staking-area h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        text-align: center;
    }
    
    #session-wallet-info {
        background: rgba(0,0,0,0.3);
        padding: 0.8rem;
        border-radius: 8px;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    #session-wallet-info p {
        margin: 0.3rem 0;
        font-size: 0.9rem;
    }
    
    .stake-controls {
        flex-direction: column;
        gap: 0.8rem;
        align-items: stretch;
    }
    
    .stake-controls input {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        text-align: center;
        border-radius: 8px;
        box-sizing: border-box;
    }
    
    .stake-controls button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
        border-radius: 8px;
        min-height: 50px;
        touch-action: manipulation;
    }
    
    /* Betting Controls - Mobil Optimized */
    .betting-controls-game {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 12px;
    }
    
    .betting-header {
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .betting-title {
        font-size: 1rem;
        margin: 0;
    }
    
    .bet-display-container {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1.2rem;
        padding: 1rem;
        background: rgba(102, 252, 241, 0.05);
        border-radius: 10px;
    }
    
    .current-bet-info, .win-amount-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .bet-label, .win-label {
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .current-bet-amount, .potential-win-amount {
        font-size: 1.1rem;
        padding: 8px 12px;
        border-radius: 12px;
        min-width: 80px;
        text-align: center;
    }
    
    .bet-adjustment-section {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .bet-adjustment-controls {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        justify-content: center;
        width: 100%;
    }
    
    .bet-adjust-btn {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
        border-radius: 50%;
        touch-action: manipulation;
        flex-shrink: 0;
    }
    
    .bet-adjustment-controls input {
        width: 80px;
        font-size: 1rem;
        padding: 10px;
        text-align: center;
        border-radius: 8px;
        flex-shrink: 0;
    }
    
    .set-bet-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 25px;
        min-height: 50px;
        touch-action: manipulation;
    }
    
    .bet-status {
        text-align: center;
        margin: 0.8rem 0;
        padding: 0.8rem;
        background: rgba(69, 162, 158, 0.1);
        border-radius: 8px;
    }
    
    .bet-warning {
        margin-top: 0.8rem;
        padding: 0.8rem;
        border-radius: 8px;
        text-align: center;
    }
    
    /* Gas Info - Mobil Optimized */
    #gas-info {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 10px;
        text-align: center;
    }
    
    #gas-info p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }
    
    .session-address-container {
        flex-direction: column;
        gap: 0.8rem;
        margin: 1rem 0;
    }
    
    #session-wallet-address-input {
        width: 100%;
        padding: 10px;
        font-size: 0.8rem;
        text-align: center;
        border-radius: 8px;
        box-sizing: border-box;
    }
    
    #copy-address-btn {
        width: 100%;
        padding: 10px;
        font-size: 0.9rem;
        border-radius: 8px;
        min-height: 45px;
    }
    
    .faucet-link {
        display: block;
        margin-top: 1rem;
        padding: 10px;
        text-align: center;
        font-size: 0.9rem;
    }
    
    /* Result Screen - Mobil Optimized */
    #resultScreen {
        padding: 1rem;
    }
    
    #resultMessage { 
        font-size: clamp(2rem, 8vw, 3rem);
        margin-bottom: 1rem;
        text-align: center;
    }
    
    #playAgainBtn {
        width: 100%;
        max-width: 300px;
        padding: 15px;
        font-size: 1.1rem;
        border-radius: 25px;
        min-height: 55px;
        touch-action: manipulation;
    }
    
    /* Popup - Mobil Optimized */
    .popup-container {
        margin: 1rem;
        min-width: 280px;
        max-width: calc(100vw - 2rem);
        border-radius: 12px;
    }
    
    .popup-header {
        padding: 1rem;
        border-bottom: 1px solid rgba(102, 252, 241, 0.2);
    }
    
    .popup-header h3 {
        font-size: 1rem;
        text-align: center;
    }
    
    .popup-body {
        padding: 1rem;
    }
    
    .popup-body p {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: center;
    }
    
    .popup-footer {
        padding: 1rem;
        text-align: center;
    }
    
    .popup-btn {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 25px;
        min-height: 50px;
        touch-action: manipulation;
    }
    
    /* Footer - Mobil Optimized */
    footer {
        padding: 1rem 0.5rem;
        text-align: center;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Scroll Optimization */
    html {
        scroll-behavior: smooth;
    }
    
    /* Touch Optimization */
    button, input, .card {
        touch-action: manipulation;
    }
    
    /* Prevent zoom on input focus */
    input[type="number"], input[type="text"] {
        font-size: 16px;
    }
}

/* Çok Küçük Ekranlar (iPhone SE, küçük Android'ler) */
@media (max-width: 375px) {
    /* Top Controls - Daha kompakt */
    .top-controls {
        padding: 0.4rem;
        gap: 0.3rem;
    }
    
    .language-btn {
        min-width: 60px;
        padding: 5px 8px;
        font-size: 0.7rem;
    }
    
    .wallet-controls button {
        padding: 5px 10px;
        font-size: 0.7rem;
        min-width: 90px;
    }
    
    .wallet-controls #userInfo {
        font-size: 0.65rem;
    }
    
    .wallet-controls #userInfo p {
        max-width: 120px;
    }
    
    .container {
        padding: 0.8rem 0.3rem;
    }
    
    header h1 {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }
    
    :root { 
        --card-width: clamp(80px, 28vw, 100px);
    }
    
    .card-display-area {
        gap: 0.5rem;
    }
    
    .controls button {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 45px;
    }
    
    .betting-controls-game {
        padding: 0.8rem;
        margin: 0.8rem 0;
    }
    
    .bet-display-container {
        padding: 0.8rem;
        gap: 0.6rem;
    }
    
    .current-bet-amount, .potential-win-amount {
        font-size: 1rem;
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .bet-adjust-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .bet-adjustment-controls input {
        width: 70px;
        padding: 8px;
        font-size: 0.9rem;
    }
    
    .set-bet-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 45px;
    }
    
    .stake-controls input,
    .stake-controls button {
        padding: 10px;
        font-size: 0.9rem;
        min-height: 45px;
    }
    
    #gas-info {
        padding: 0.8rem;
    }
    
    #gas-info p {
        font-size: 0.8rem;
    }
    
    #session-wallet-address-input {
        padding: 8px;
        font-size: 0.7rem;
    }
    
    .popup-container {
        margin: 0.5rem;
        min-width: 260px;
    }
    
    .popup-body p {
        font-size: 0.9rem;
    }
}

/* Landscape Mode için Özel Ayarlar */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
    body {
        padding: 0;
    }
    
    .top-controls {
        position: relative;
        padding: 0.2rem 0.3rem;
        margin-bottom: 0.3rem;
        gap: 0.3rem;
    }
    
    .language-btn {
        min-width: 55px;
        padding: 4px 8px;
        font-size: 0.65rem;
    }
    
    .wallet-controls button {
        padding: 4px 8px;
        font-size: 0.65rem;
        min-width: 80px;
    }
    
    .wallet-controls #userInfo {
        font-size: 0.6rem;
    }
    
    .wallet-controls #userInfo p {
        max-width: 100px;
    }
    
    .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .card-display-area {
        margin-bottom: 0.8rem;
    }
    
    :root { 
        --card-width: clamp(70px, 20vw, 90px);
    }
    
    .controls {
        margin-bottom: 0.8rem;
    }
    
    .controls button {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .betting-controls-game {
        padding: 0.8rem;
        margin: 0.8rem 0;
    }
    
    #staking-area {
        padding: 0.8rem;
    }
    
    #gas-info {
        margin-top: 0.8rem;
        padding: 0.8rem;
    }
}

/* Game in progress state */
.betting-controls-game.game-in-progress {
    opacity: 0.7;
    pointer-events: none;
}

.betting-controls-game.game-in-progress::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    z-index: 1;
}

.betting-controls-game {
    position: relative;
}
