/* CSS Custom Properties */
:root {
    --bg-dark: oklch(14.1% 0.005 285.823);
    --bg-light: oklch(97% 0.005 285.823);
    --text-dark: oklch(97% 0 0);
    --text-light: oklch(14.1% 0 0);
    --header-dark: #0e0e11;
    --header-light: oklch(90.844% 0.0082 286.055);
    --primary-green: #4CAF50;
    --primary-green-hover: #5CBF60;
    --primary-green-dark: #2E7D32;
    --overlay-light: rgba(255, 255, 255, 0.1);
    --overlay-dark: rgba(0, 0, 0, 0.05);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-dark: rgba(0, 0, 0, 0.15);
    --transition: all 0.2s ease;
}

/* Body and base styles */
body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
}

body.lightmode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Header styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid gray;
    background-color: var(--header-dark);
    width: 100%;
    padding: 10px 15px;
    box-sizing: border-box;
    min-height: 80px;
}

body.lightmode header {
    background-color: var(--header-light);
}

.coin_flip_section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 120px;
}

.header_content {
    text-align: center;
    flex: 1;
    margin: 0 20px;
    min-width: 0;
}

.header_content h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header_content p {
    margin: 0;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

.buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    min-width: 120px;
    justify-content: flex-end;
}

header button {
    border: none;
    cursor: pointer;
    padding: 7px;
    margin: 2px;
    border-radius: 50%;
}

header button#green_screen_button {
    background-color: rgb(0, 255, 0);
}

header button#transparency_button {
    background-color: red;
}

/* Responsive header */
@media (max-width: 768px) {
    .header_content h1 {
        font-size: clamp(1.4rem, 6vw, 2rem);
    }
    
    .coin_flip_section,
    .buttons {
        min-width: 80px;
    }
    
    .buttons {
        gap: 3px;
    }
    
    header button {
        padding: 6px;
        margin: 1px;
    }
    
    #coin_flip_button {
        padding: 8px 12px;
        font-size: 0.8em;
    }
    
    #coin_flip_button span {
        display: none;
    }
}

/* App container */
#app {
    margin: 20px;
}

/* Number input controls */
.number_input_container {
    display: inline-flex;
    align-items: center;
    margin: 0 8px;
}

.number_input_container:focus-within {
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
    border-radius: 6px;
}

body.lightmode .number_input_container:focus-within {
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
}

.number_entry {
    background: var(--overlay-light);
    border: 1px solid var(--border-light);
    border-left: none;
    border-right: none;
    border-radius: 0;
    color: inherit;
    padding: 8px 10px;
    font-size: 1em;
    width: 60px;
    text-align: center;
    transition: var(--transition);
    outline: none;
}

.number_entry:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-green);
}

/* Hide default spinners */
.number_entry::-webkit-outer-spin-button,
.number_entry::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.number_entry[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.increment_btn {
    background: var(--overlay-light);
    border: 1px solid var(--border-light);
    color: inherit;
    width: 28px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: var(--transition);
    user-select: none;
}

.increment_btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

.increment_btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

.increment_btn:hover {
    background: rgba(76, 175, 80, 0.2);
}

.increment_btn:active {
    background: rgba(76, 175, 80, 0.3);
    transform: scale(0.95);
}

/* Light mode overrides */
body.lightmode .number_entry {
    background: var(--overlay-dark);
    border-color: var(--border-dark);
}

body.lightmode .number_entry:focus {
    background: rgba(0, 0, 0, 0.08);
}

body.lightmode .increment_btn {
    background: var(--overlay-dark);
    border-color: var(--border-dark);
}

body.lightmode .increment_btn:hover {
    background: rgba(76, 175, 80, 0.15);
}

body.lightmode .increment_btn:active {
    background: rgba(76, 175, 80, 0.25);
}

/* Generate button */
.major_button {
    background: linear-gradient(135deg, var(--primary-green), #45a049);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    margin-left: 12px;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.major_button:hover {
    background: linear-gradient(135deg, var(--primary-green-hover), var(--primary-green));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.major_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Max indicator */
.max_indicator {
    font-size: 0.85em;
    color: #888;
    margin-left: 8px;
    font-style: italic;
}

body.lightmode .max_indicator {
    color: #666;
}

#max_value {
    font-weight: bold;
    color: var(--primary-green);
}

body.lightmode #max_value {
    color: var(--primary-green-dark);
}

/* Image styles */
img {
    width: max(17vw, 150px);
    border-radius: 15px;
    outline: 2px solid mediumseagreen;
    outline-offset: 2px;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.struck img {
    filter: grayscale(100%);
}

.struck {
    opacity: 0.5;
}

.notransparency .struck {
    opacity: 1;
}

.counterpick {
    outline-color: gold;
}

/* Output container */
#output_segment {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px 10px;
    width: 100%;
}

.output_item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 10px;
    position: relative;
    cursor: pointer;
    transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.output_item:hover {
    transform: scale(1.05);
}

.output_item label {
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 5px;
}

/* Banned overlay text */
div.banned-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.95);
    color: white;
    font-weight: bold;
    font-size: 1.5em;
    padding: 8px 16px;
    border-radius: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 10;
    pointer-events: none;
    letter-spacing: 2px;
    border: 2px solid #ff4444;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
}

div.banned-overlay.player2 {
    background-color: rgba(0, 60, 255, 0.95);
    border: 2px solid #4470ff;
    box-shadow: 0 0 15px rgba(0, 89, 255, 0.8);
}

div.banned-overlay.dsr {
    background-color: rgba(49, 49, 49, 0.95);
    border: 2px solid #a3a3a3;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

/* Protected overlay text for last map protection */
.protected-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 255, 0, 0.95);
    color: white;
    font-weight: bold;
    font-size: 1.3em;
    padding: 8px 16px;
    border-radius: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 15;
    pointer-events: none;
    letter-spacing: 2px;
    border: 2px solid #44ff44;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
    animation: protectedPulse 1.5s ease-in-out;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake-protection {
    animation: shake 0.6s ease-in-out;
}

@keyframes protectedPulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* Strike pattern display */
#recommended_strike_pattern {
    margin-top: 20px;
    text-align: center;
    justify-content: center;
    margin-bottom: 10px;
}

#recommended_strike_pattern h3 {
    margin-bottom: 5px;
}

#strike_pattern_container {
    display: inline;
    justify-content: center;
    width: auto;
}

.strike_pattern_item {
    display: inline;
    font-size: 2em;
    font-weight: bold;
    color: oklch(57.7% 0.245 27.325);
    min-width: 40px;
    text-align: center;
    cursor: help;
}

.strike_pattern_item.p2_strike_item {
    color: oklch(54.6% 0.245 262.881);
}

.strike_pattern_item.ban_strike_item {
    color: oklch(66.11% 0.29729 324.03);
}

/* Tips segment styles */
.tips_segment {
    display: flex;
    justify-content: center;
    margin: 0 20px 20px 20px;
}

.infobox {
    background-color: var(--overlay-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0px 20px;
    margin: 0px 20px;
    font-size: 0.9em;
    font-style: italic;
    color: #ccc;
    width: auto;
    min-width: 30%;
    max-width: 60%;
    text-align: center;
    justify-content: center;
}

/* Confirmation modal styles */
#pick_options_container {
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    justify-content:center;
    margin-top:12px;
}

.pick_image {
    width:120px;
    height:auto;
    border-radius:8px;
    outline:2px solid #666;
}

.pick_label {
    margin-top: 5px;
    text-align: center;
}

.pick_card {
    display:flex;
    flex-direction:column;
    align-items:center;
    cursor:pointer;
    min-width:120px;
}

.pick_card:hover {
    transform: scale(1.05);
    transition: var(--transition);
}