body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    background: #111827 url('./assets/poker-mat-background-webp.webp') no-repeat center center fixed;
    background-size: cover;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Sticky first column for mobile tables */
.table-container th:first-child,
.table-container td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(8px);
}

.table-container th:first-child::after,
.table-container td:first-child::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to right, rgba(0,0,0,0.2), transparent);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.5) 100%); /* Vignette for table depth */
    z-index: -1;
}

.dice-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.cell-active:hover {
    background-color: rgba(59, 130, 246, 0.2);
    cursor: pointer;
}

.cell-filled {
    color: #fbbf24;
    font-weight: bold;
}

.cell-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.table-container {
    scrollbar-width: thin;
    scrollbar-color: #4b5563 #1f2937;
}

.table-container::-webkit-scrollbar {
    width: 6px;
}

.table-container::-webkit-scrollbar-track {
    background: #1f2937;
}

.table-container::-webkit-scrollbar-thumb {
    background-color: #4b5563;
    border-radius: 20px;
}

/* High Contrast Accessibility Mode */
.high-contrast {
    background-image: none !important;
    background-color: #000 !important;
}

.high-contrast::before {
    display: none !important;
}

.high-contrast .bg-black\/60,
.high-contrast .bg-black\/70,
.high-contrast .bg-gray-800,
.high-contrast .bg-gray-900,
.high-contrast .bg-gray-950,
.high-contrast .bg-green-950\/40 {
    background-color: #000 !important;
    border-color: #fff !important;
}

.high-contrast .text-gray-300,
.high-contrast .text-gray-400,
.high-contrast .text-gray-500,
.high-contrast .text-green-100\/80 {
    color: #fff !important;
}

.high-contrast .text-yellow-400,
.high-contrast .text-yellow-500,
.high-contrast .text-blue-400,
.high-contrast .text-blue-500,
.high-contrast .text-green-400,
.high-contrast .text-green-500 {
    color: #ffff00 !important; /* Brighter yellow for visibility */
}

.high-contrast .border-gray-700,
.high-contrast .border-gray-800,
.high-contrast .border-green-800\/50,
.high-contrast .border-green-500\/30 {
    border-color: #fff !important;
    border-width: 1px !important;
}

.high-contrast .shadow-2xl,
.high-contrast .shadow-lg,
.high-contrast .shadow-inner {
    box-shadow: none !important;
}

.high-contrast .backdrop-blur-md,
.high-contrast .backdrop-blur-sm {
    backdrop-filter: none !important;
}

.high-contrast button {
    border: 2px solid #fff !important;
}

.high-contrast input[type="range"] {
    accent-color: #ffff00 !important;
}

.high-contrast .table-container th:first-child,
.high-contrast .table-container td:first-child {
    background-color: #000 !important;
    border-right: 1px solid #fff !important;
}
