body {
    font-family: Arial, sans-serif;
    background-color: #111;
    background-image: radial-gradient(circle at 50% 0%, #1e1e26 0%, #0a0a0d 70%);
    color: white;
    text-align: center;
    margin: 0;
    padding: 20px;
}

.game-container {
    max-width: 760px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* --- Cabecera --- */
.header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
}

.btn-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    margin-bottom: 15px;
    cursor: pointer;
}

.btn-back:hover {
    background: #f1c40f;
    color: #111;
    border-color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.4);
    transform: translateY(-2px);
}

/* --- Barra de saldo / apuesta / fichas --- */
.betting-area {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.75), rgba(15, 15, 15, 0.95));
    border: 2px solid #f1c40f;
    box-shadow: 0 8px 32px 0 rgba(241, 196, 15, 0.25), inset 0 0 15px rgba(241, 196, 15, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.balance-display {
    font-weight: bold;
    font-size: 20px;
    color: #f1c40f;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

.petocoin-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    vertical-align: middle;
    animation: spin-coin 4s linear infinite;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.petocoin-icon-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

@keyframes spin-coin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.apostado-display {
    font-weight: bold;
    font-size: 15px;
    color: #ccc;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.15);
}

.apostado-display span {
    color: #f1c40f;
}

/* --- Selector de fichas --- */
.chip-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 16px;
}

.chip {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px dashed rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
    cursor: pointer;
    color: #111;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    flex-shrink: 0;
}

.chip:hover { transform: translateY(-3px); }

.chip.activa {
    border-style: solid;
    border-color: #fff;
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 0 0 3px #f1c40f, 0 6px 14px rgba(241, 196, 15, 0.4);
}

.chip-10 { background: #4b8bf5; }
.chip-50 { background: #e74c3c; }
.chip-100 { background: #2ecc71; }
.chip-500 { background: #9b59b6; }
.chip-1000 { background: #f1c40f; }

/* --- Rueda --- */
.wheel-wrap {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 0 auto 18px;
}

.wheel-pointer {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #f1c40f;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

.wheel-svg {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 6px #7a5b13, 0 0 0 10px #2c2c35, 0 10px 30px rgba(0,0,0,0.6);
    background: #0c0c10;
}

#wheel-group {
    transform-origin: 130px 130px;
    transition: transform 4.2s cubic-bezier(0.15, 0.85, 0.2, 1);
}

#ball-group {
    transform-origin: 130px 130px;
    transition: transform 4.2s cubic-bezier(0.1, 0.7, 0.15, 1);
}

.wheel-center {
    fill: url(#hubGrad);
    stroke: #f1c40f;
    stroke-width: 2;
}

/* --- Resultado ganador destacado --- */
.resultado-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 1.2rem;
    vertical-align: middle;
    border: 2px solid rgba(255,255,255,0.4);
}

.color-rojo { background: #d32f2f; color: #fff; }
.color-negro { background: #181818; color: #fff; }
.color-verde { background: #0b6623; color: #fff; }

/* --- Historial --- */
.historial {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
    min-height: 30px;
}

.historial-item {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    border: 1px solid rgba(255,255,255,0.25);
}

/* --- Mesa de apuestas --- */
.mesa {
    background: linear-gradient(160deg, #0e3b20, #0a2c18);
    border: 4px solid #7a5b13;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.mesa-grid {
    display: grid;
    grid-template-columns: 46px repeat(12, 46px) 52px;
    grid-template-rows: repeat(3, 46px);
    gap: 3px;
    width: max-content;
    margin: 0 auto;
}

.celda {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: filter 0.15s ease, transform 0.1s ease;
    border: 1px solid rgba(255,255,255,0.15);
}

.celda:hover { filter: brightness(1.25); }
.celda:active { transform: scale(0.95); }

.celda.rojo { background: #c0392b; }
.celda.negro { background: #1c1c1c; }
.celda.verde { background: #0b6623; grid-row: 1 / span 3; }
.celda.columna {
    background: #142a1c;
    font-size: 0.6rem;
    line-height: 1.1;
    padding: 2px;
    text-align: center;
}

.celda.ganadora {
    box-shadow: 0 0 0 3px #f1c40f, 0 0 18px rgba(241, 196, 15, 0.8);
    z-index: 2;
}

.ficha-marca {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(241, 196, 15, 0.95);
    color: #111;
    font-size: 0.6rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 8px;
    box-shadow: 0 0 6px rgba(0,0,0,0.6);
    pointer-events: none;
}

.mesa-exteriores {
    width: max-content;
    margin: 6px auto 0;
    display: grid;
    grid-template-columns: repeat(6, 88px);
    gap: 3px;
}

.celda-ext {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.15);
    background: #142a1c;
    color: #fff;
    position: relative;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.celda-ext:hover { filter: brightness(1.3); }
.celda-ext:active { transform: scale(0.96); }
.celda-ext.rojo { background: #c0392b; }
.celda-ext.negro { background: #1c1c1c; }
.celda-ext.ganadora { box-shadow: 0 0 0 3px #f1c40f, 0 0 18px rgba(241, 196, 15, 0.8); }

.mesa-docenas {
    width: max-content;
    margin: 3px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 176px);
    gap: 3px;
}

.celda-docena {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255,255,255,0.15);
    background: #142a1c;
    color: #fff;
    position: relative;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.celda-docena:hover { filter: brightness(1.3); }
.celda-docena.ganadora { box-shadow: 0 0 0 3px #f1c40f, 0 0 18px rgba(241, 196, 15, 0.8); }

/* --- Controles --- */
.controles {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #f1c40f;
    color: #333;
    transition: 0.3s;
}

.btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

.btn:hover:not(:disabled) {
    background-color: #f39c12;
}

.btn-secundario {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-secundario:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
}

.btn-girar {
    background: linear-gradient(135deg, #d32f2f, #a91f1f);
    color: #fff;
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.4);
}

.btn-girar:hover:not(:disabled) {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

#mensaje {
    min-height: 30px;
    margin: 12px 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.nota-info {
    color: #999;
    font-size: 0.78rem;
    line-height: 1.4;
    max-width: 560px;
    margin: 14px auto 0;
}

@media (max-width: 560px) {
    .wheel-wrap { width: 210px; height: 210px; }
}
