@font-face{ 
    font-family: 'coiny';
    src: url('/stc/third-party/Coiny-Regular.ttf');
}

* {
    /* Removed touch-action: none; and user-select: none; to allow default browser behavior */
}

body {
    height: 100%; /* Keep for full viewport height */
    overflow: auto; /* Changed to auto to allow scrolling */
    /* Removed -webkit-touch-callout, -webkit-text-size-adjust, -webkit-user-select, -webkit-tap-highlight-color */
    background-color: #F0EAD6; /* Cream/Off-white */

    /* Flexbox for centering the primary containers */
    display: flex;
    flex-direction: column;
    align-items: center; /* Center horizontally */
    min-height: 100vh; /* Ensure body takes full viewport height */
    padding: 10px; /* Small padding around the edge */
    box-sizing: border-box; /* Include padding in height calculation */
}

/* Main containers for different screens */
div#main-container,
div#help-container,
div#about-container,
div#fp-container,
div#error-container {
    position: relative; /* Changed from absolute for flexbox centering */
    height: auto; /* Let content define height */
    width: 90%; /* Responsive width */
    max-width: 500px; /* Max width for larger screens */
    /* Removed margin: auto; as parent body handles centering */
    box-sizing: border-box; /* Include padding/border in width */
    padding: 10px; /* Add some internal padding */
    background-color: #F0EAD6; /* Match body background */
    border-radius: 15px; /* Consistent rounded corners */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Subtle shadow for depth */
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
}

/* Board container - keep its specific padding/margin */
div#board-container {
    display: flex; /* Make it a flex container */
    justify-content: center; /* Center canvas horizontally within this container */
    align-items: center; /* Center canvas vertically within this container */
    width: fit-content; /* Make the container shrink-wrap its content */
    margin-left: auto;   /* Center horizontally */
    margin-right: auto;  /* Center horizontally */
    padding: 2px;
    margin-top: 4px;
    margin-bottom: 20px;
    border-width: 5px;
    border-style: solid;
    border-color: #8A4C14;
    /* Remove fixed width/height here, UIManager handles it */
}


div.help {
    font-size: 20px; /* Adjusted for better readability */
    line-height: 1.5;
    margin-left: auto;
    margin-right: auto;
    border: 4px solid #8A4C14; /* Darker brown */
    border-radius: 20px; /* Slightly smaller radius for inner box */
    padding: 20px; /* Adjusted padding */
    text-align: left;
    background-color: #F0EAD6; /* Cream/Off-white */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1); /* Inner shadow for depth */
}

div.help ul {
    list-style-type: disc; /* Ensure bullet points are visible */
    padding-left: 20px;
    margin-left: 0;
}

div.help li {
    margin-bottom: 10px;
    color: #8A4C14; /* Darker brown for list items */
}

div.help p {
    color: #8A4C14; /* Darker brown for paragraphs */
}

#board {
    z-index: 0;
    border-style: solid;
    border-color: #8A4C14; /* Darker brown */
}

@media not all and (hover: none) {
    div.playgrid div:hover {
        background-color: #D4B963; /* Muted yellow/brown */
        opacity: 0.5;
    }
}

h1 {
    font-size: 50px;
    font-family: 'coiny';
    margin-top: -15px;
    margin-bottom: 15px;
    color: #E67E22; /* Burnt Orange */
    text-align: center; /* Center headings */
}

.super-gradient {
    background: linear-gradient(to right, #FFD700, #FFA500, #FF4500); /* Gold, Orange, OrangeRed */
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent; /* For WebKit browsers */
    display: inline-block; /* Ensure the background covers the full text height */
    height: 70px; /* Ensure enough space for descenders */
    margin-bottom: -20px;
}

h2 {
    margin-top: 0px;
    font-size: clamp(28px, 7vw, 40px); /* Responsive font size */
    font-family: 'coiny';
    text-align: center;
    color: #E67E22; /* Burnt Orange */
    margin-bottom: 10px;
}

h3 {
    margin-top: 0px;
    font-size: clamp(22px, 6vw, 30px); /* Responsive font size */
    font-family: 'coiny';
    text-align: center;
    color: #E67E22; /* Burnt Orange */
    margin-bottom: 10px;
}

/* Front page specific styling */
div.fp {
    /* This class is applied to the main containers, so its styles are now merged above */
    /* Remove redundant width/margin here */
}

/* Buttons */
a.button {
    display: flex; /* Make it a flex container to control its internal layout */
    justify-content: center; /* Center content horizontally */
    height: 40px; /* Slightly smaller height for better fit */
    text-align: center; /* Still useful for text alignment within the flex item */
    padding: 0px 20px; /* Horizontal padding */
    font-size: 32px;
    line-height: 36px;
    border-radius: 12px;
    background-color: #E67E22; /* Burnt Orange */
    border: solid 1px #B8651B; /* Darker Burnt Orange */
    box-shadow: 5px 5px 0px 0px #8A4C14; /* Original shadow */
    font-family: 'coiny';
    margin-top: 10px;
    -webkit-tap-highlight-color: #FF9933; /* Lighter Burnt Orange */
    touch-action: manipulation;
    cursor: pointer; /* Indicate clickable */
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; /* Smooth transitions */
    flex-grow: 1; /* Allow buttons to grow in flex container */
    white-space: nowrap; /* Prevent text wrapping */
    text-decoration: none; /* Remove underline */
    color: inherit; /* Inherit text color from parent */
}

a.button:active {
    background-color: #B8651B; /* Darker on press */
    box-shadow: 2px 2px 0px 0px #8A4C14; /* Smaller shadow on press */
    transform: translate(3px, 3px); /* Simulate press depth */
}

@media not all and (hover: none) {
    a.button:hover {
        background-color: #FF9933; /* Lighter Burnt Orange */
        box-shadow: 6px 6px 0px 0px #8A4C14; /* Slightly larger shadow on hover */
    }
}

div#buttons {
    display: flex;
    justify-content: center; /* Center buttons */
    flex-direction: row;
    flex-wrap: nowrap; /* Force buttons into a single row */
    gap: 10px; /* Space between buttons */
    margin-top: 20px; /* More space above buttons */
}

div#buttons div.separator {
    /* Separator is less needed with gap, but can keep for specific spacing */
    width: 10px;
    flex-shrink: 0; /* Prevent shrinking */
}

div.playgrid div {
    position: absolute;

    width: 50px;
    height: 50px;
    padding: 0px;
    vertical-align: top;
    text-align: center;
    font-family: 'coiny';
    font-size: 40px;
    margin: 0px;
    color: #8A4C14; /* Darker brown for numbers */
}

#board div.line {
    background-color: #F7DC6F; /* Mustard Yellow */
    box-shadow: 3px 3px 0px 0px #C2A858; /* Darker Mustard */
    z-index: -1;
    border-radius: 25px;
    border: solid 1px #D4B963; /* Slightly Darker Mustard */
}

#board div.line-match {
    background-color: #27AE60; /* Forest Green */
    box-shadow: 3px 3px 0px 0px #1F8C4D; /* Darker Forest Green */
    border: solid 1px #229A54; /* Slightly Darker Forest Green */
}

#board div.line-toolong {
    background-color: #C0392B; /* Muted Red */
    box-shadow: 3px 3px 0px 0px #9A2E23; /* Darker Muted Red */
    border: solid 1px #A83327; /* Slightly Darker Muted Red */
}

#board div.blocked {
    background-color: #C0392B; /* Muted Red */
}

@keyframes blink {
    from { background-color: rgba(192, 57, 43, 1); } /* Muted Red */
    50% { background-color: rgba(39, 174, 96, 0); } /* Forest Green, transparent */
    to { background-color: rgba(192, 57, 43, 1); } /* Muted Red */
}

div.blink {
    animation-name: blink;
    animation-duration: 0.1s;
    animation-iteration-count: 3;
}
