@font-face {
    font-family: 'Mesgentia';
    src: url('/assets/fonts/Mesgentia.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 100%;
    descent-override: 20%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Mineko';
    src: url('/assets/fonts/Mineko.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 97.5%;
    descent-override: 22.5%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftRegular-Bmg3.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Minecraft';
    src: url('/assets/fonts/MinecraftBold-nMK1.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Manito';
    src: url('/assets/fonts/Hakgyoansim_ManitoR.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Imprima';
    src: url('/assets/fonts/Imprima-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Regular.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Bold.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Italic.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-BoldItalic.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: italic;
}

:root {
    --primary: #B8878C;
    --primary-light: #c9a8a8;
    --sync-fill: #f1f1ef;
    --primary-lighter: rgba(184, 135, 140, 0.15);
    --primary-hover: #dcc3c6;
    --background: #FDF8F4;
    --cream: rgba(184, 135, 140, 0.08);
    --text: #4A4A4A;
    --text-muted: #8c8985;
    --border: #deb8b8;
    --white: #fff;
    --scale: 1;
    
    --widget-width: 380px;
    --widget-height: 480px;
    --card-width: 330px;
    --card-height: 198px;
    
    --card-border-radius: 20px;
    --card-font-size: 16px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #121212;
        --white: #1e1e1e;
        --cream: #252525;
        --text: #e3e3e2;
        --text-muted: #9b9a97;
        --primary-light: #37352f;
        --sync-fill: #2a2a2a;
        --primary-lighter: #2f2f2f;
        --border: #37352f;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --background: #121212;
    --sync-fill: #2a2a2a;
    --white: #1e1e1e;
    --cream: #252525;
    --text: #e3e3e2;
    --text-muted: #9b9a97;
    --primary-light: #37352f;
    --primary-lighter: #2f2f2f;
    --border: #37352f;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --background: #FDF8F4;
    --sync-fill: #f1f1ef;
    --white: #fff;
    --cream: rgba(184, 135, 140, 0.08);
    --text: #4A4A4A;
    --text-muted: #8c8985;
    --border: #deb8b8;
    color-scheme: light;
}

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

button, input, select, textarea {
    font-family: inherit;
}

html {
    background: transparent !important;
}

body {
    font-family: var(--font-family);
    background: transparent !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.y2k-window {
    width: var(--widget-width);
    height: var(--widget-height);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    zoom: var(--scale);
}

.y2k-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 8px;
    position: relative;
}

.y2k-title-bar-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.y2k-title-text {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--primary);
}

.y2k-settings-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: background-color 0.15s, color 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.y2k-settings-btn:hover {
    background: var(--primary-hover);
    color: var(--primary);
}

.y2k-settings-btn svg {
    display: block;
    transition: transform 0.3s ease;
}

.y2k-settings-btn:hover svg {
    transform: rotate(45deg);
}

.koucard-container {
    display: flex;
    flex-direction: column;
    padding: 10px;
    background-color: var(--white);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.koucard-container::-webkit-scrollbar {
    width: 4px;
}

.koucard-container::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 2px;
}


.presets-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.preset-btn {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 3px 8px;
    font-size: 7.5px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.preset-btn:hover {
    background: var(--primary-hover);
    color: var(--primary);
}

.preset-btn.active {
    background: var(--primary);
    color: var(--on-accent, var(--white));
    border-color: var(--primary);
}

.card-area-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 6px;
    min-height: 100px;
}

.card-perspective-wrapper {
    perspective: 1000px;
    width: 100%;
    height: var(--card-height);
    position: relative;
    transition: width 0.3s, height 0.3s;
}

.flashcard-element {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    border-radius: var(--card-border-radius);
    will-change: transform;
}

.flashcard-element.flipped {
    transform: rotateY(180deg);
}

.flashcard-element.flipping-fwd,
.flashcard-element.flipping-bwd {
    transition: none;
}

.flashcard-element.flipping-fwd {
    animation: kouFlipFwd 0.62s cubic-bezier(0.45, 0.03, 0.35, 1);
}

.flashcard-element.flipping-bwd {
    animation: kouFlipBwd 0.62s cubic-bezier(0.45, 0.03, 0.35, 1);
}

@keyframes kouFlipFwd {
    0%   { transform: rotateY(0deg) scale(1); }
    50%  { transform: rotateY(90deg) scale(0.9); }
    100% { transform: rotateY(180deg) scale(1); }
}

@keyframes kouFlipBwd {
    0%   { transform: rotateY(180deg) scale(1); }
    50%  { transform: rotateY(90deg) scale(0.9); }
    100% { transform: rotateY(0deg) scale(1); }
}

.flashcard-element.flipped .card-front,
.flashcard-element:not(.flipped) .card-back {
    visibility: hidden;
}

.flashcard-element.flipping-fwd .card-front,
.flashcard-element.flipping-bwd .card-back {
    animation: kouFaceOut 0.62s linear;
}

.flashcard-element.flipping-fwd .card-back,
.flashcard-element.flipping-bwd .card-front {
    animation: kouFaceIn 0.62s linear;
}

@keyframes kouFaceOut {
    0%, 49.9% { visibility: visible; }
    50%, 100% { visibility: hidden; }
}

@keyframes kouFaceIn {
    0%, 49.9% { visibility: hidden; }
    50%, 100% { visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
    .flashcard-element.flipping-fwd,
    .flashcard-element.flipping-bwd,
    .flashcard-element.flipping-fwd .card-face,
    .flashcard-element.flipping-bwd .card-face {
        animation: none;
    }
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: calc(var(--card-border-radius) - 1px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-front {
    background: #FDF8F4;
    z-index: 2;
}

.card-back {
    background: #FDF8F4;
    transform: rotateY(180deg);
}

.card-paper-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.card-face[data-style="grid"] .card-paper-pattern {
    background-image: 
        linear-gradient(var(--face-line-color) 0.5px, transparent 0.5px),
        linear-gradient(90deg, var(--face-line-color) 0.5px, transparent 0.5px);
    background-size: 12px 12px;
    background-position: center;
}

.card-face[data-style="dotted"] .card-paper-pattern {
    background-image: radial-gradient(circle, var(--face-line-color) 1px, transparent 1px);
    background-size: 12px 12px;
    background-position: center;
}

.card-content-editable {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    padding: 16px 20px;
    overflow-y: auto;
    outline: none;
    font-family: var(--card-font-family);
    font-size: var(--card-font-size);
    color: var(--face-text-color, var(--text));
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center;
    align-items: center;
    align-items: safe center;
    text-align: center;
}

.card-content-editable[style*="font-family: 'Courier Prime'"] {
    padding: 15px 20px 17px 20px;
}

.card-content-editable img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    margin: 4px 0;
}

.card-content-editable::-webkit-scrollbar {
    width: 3px;
}

.card-content-editable::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 1px;
}

.card-content-editable[placeholder]:empty:before {
    content: attr(placeholder);
    color: var(--face-text-color, var(--text-muted));
    opacity: 0.6;
    font-style: italic;
    cursor: text;
}

.study-controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.study-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.study-btn:hover {
    background: var(--primary-hover);
    color: var(--primary);
}

.study-btn svg {
    width: 10px;
    height: 10px;
}

.study-btn.secondary {
    border-radius: 999px;
    width: auto;
    padding: 2px 8px;
    font-size: 7px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.card-counter-label {
    font-size: 7px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 60px;
    text-align: center;
    text-transform: uppercase;
}

.action-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.deck-select {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    height: 22px;
    padding: 4px 10px;
    font-size: 8.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23B8878C' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 20px;
}

.action-buttons-group {
    display: flex;
    gap: 4px;
}

.action-icon-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.action-icon-btn svg {
    width: 11px;
    height: 11px;
}

.action-icon-btn:hover {
    background: var(--primary-hover);
    color: var(--primary);
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: none;
    z-index: 999;
}

.settings-overlay.active {
    display: block;
}

.new-deck-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: none;
    z-index: 1050;
}

.new-deck-popup-overlay.active {
    display: block;
}

.new-deck-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 230px;
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: 16px;
    padding: 16px 14px 14px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 1060;
    box-sizing: border-box;
    zoom: var(--scale);
}

.new-deck-popup.active {
    display: flex;
}

.new-deck-popup-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.new-deck-popup-input {
    width: 100%;
    font-size: 12px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    box-sizing: border-box;
    outline: none;
    text-align: center;
}

.new-deck-popup-input:focus {
    border-color: var(--primary);
}

.new-deck-popup-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.new-deck-popup-btn {
    font-size: 11px;
    padding: 5px 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    transition: background-color 0.15s, border-color 0.15s;
}

.new-deck-popup-btn:hover {
    background-color: var(--primary-lighter);
}

.new-deck-popup-btn.primary {
    background: var(--primary);
    color: var(--on-accent, var(--white));
    border-color: var(--primary);
}

.new-deck-popup-btn.primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    max-height: 85vh;
    background: var(--white);
    border: 1px solid var(--primary);
    border-radius: 16px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.settings-panel.active {
    display: block;
}

.settings-content {
    padding: 12px;
    max-height: calc(85vh - 4px);
    overflow-y: auto;
}

.settings-content::-webkit-scrollbar {
    width: 4px;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--primary-lighter);
    padding-bottom: 8px;
}

.settings-header h3 {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.15s, background-color 0.15s;
    flex-shrink: 0;
}

.settings-close:hover {
    opacity: 1;
    background: var(--primary-hover);
}

.settings-group-header {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 14px;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--primary-lighter);
    padding-bottom: 2px;
}

.settings-section {
    margin-bottom: 12px;
}

.settings-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    display: block;
}

.font-select {
    width: 100%;
    padding: 6px 12px;
    font-size: 10px;
    border: none;
    border-radius: 999px;
    background: var(--primary-lighter);
    color: var(--text);
    cursor: pointer;
    appearance: none;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 1 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: background-color 0.15s ease;
}

.font-select:hover {
    background-color: var(--primary-hover);
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input-wrapper input[type="color"] {
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-lighter);
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    padding: 0;
    background: none;
}

.settings-panel #titlebar-color,
.settings-panel .titlebar-clear {
    width: 18px;
    height: 18px;
}

.settings-panel .titlebar-clear {
    background: none;
    opacity: 1;
    margin-left: -6px;
}

.settings-panel .titlebar-clear svg {
    width: 10px;
    height: 10px;
}

.settings-panel .titlebar-clear:hover {
    color: var(--text);
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.color-hex {
    width: 62px;
    height: 18px;
    font-size: 10px;
    font-family: inherit;
    color: var(--text);
    font-weight: 400;
    background: var(--primary-lighter);
    border: none;
    border-radius: 999px;
    padding: 3px 6px;
    text-align: center;
    outline: none;
    transition: background-color 0.15s ease;
}

.color-hex:focus {
    background: var(--primary-light);
}

.scale-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scale-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: var(--primary-lighter);
    border-radius: 2px;
    outline: none;
}

.scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.scale-value {
    font-size: 10px;
    color: var(--text);
    min-width: 28px;
    text-align: right;
}

.sync-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--primary-lighter);
}

.sync-section label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.sync-status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.sync-status-text.synced {
    color: var(--primary);
}

.sync-controls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.sync-buttons-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
    width: 100%;
}

.sync-buttons-row .sync-btn {
    flex: 1;
    min-width: 0;
    font-size: 10px;
}

.sync-btn {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border: none;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--primary);
    color: var(--on-accent, white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.sync-btn:active {
    transform: scale(0.98);
}

.sync-btn.secondary {
    background: var(--sync-fill);
    color: var(--text);
}

.sync-btn.danger {
    background: rgba(231, 76, 60, 0.15);
    color: #c0392b;
}

.sync-btn.danger:hover {
    background: rgba(231, 76, 60, 0.25);
}

#sync-code-input {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border: none;
    border-radius: 999px;
    font-size: 9px;
    font-family: inherit;
    background: var(--primary-lighter);
    transition: background-color 0.15s ease;
}

#sync-code-input:focus {
    outline: none;
    background: var(--primary-light);
}

.sync-hint {
    font-size: 9px;
    color: var(--text-muted);
    margin: 12px 0 0 0;
    text-align: center;
}

.sync-status-panel {
    background: var(--primary-lighter);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid var(--primary-lighter);
}

.sync-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    min-height: 24px;
}

.sync-status-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sync-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
}

.sync-value {
    font-size: 10px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.sync-time-value {
    color: var(--text-muted);
    font-size: 10px;
}

.sync-code-row {
    flex-wrap: nowrap;
    gap: 6px;
}

.sync-code-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: var(--white);
    border-radius: 999px;
    border: 1px solid var(--primary-lighter);
    min-width: 0;
    flex-shrink: 1;
    max-width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sync-code-pill:hover {
    background: var(--primary-hover);
}

.sync-code-pill:active {
    transform: scale(0.97);
}

.sync-code-value {
    font-family: 'Courier Prime', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.3px;
    margin-top: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-link-section {
    margin-top: 12px;
    padding-top: 12px;
    margin-bottom: 12px;
    border-top: 1px solid var(--primary-lighter);
}

.share-link-section label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.share-link-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-lighter);
    border-radius: 999px;
    padding: 6px 6px 6px 12px;
}

.share-link-input {
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    border: none;
    background: transparent;
    font-size: 11px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.share-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: var(--primary);
    color: var(--on-accent, white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.share-copy-btn:active {
    transform: scale(0.98);
}

.share-copy-btn svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

.deck-link-section .font-select {
    margin-bottom: 6px;
}

.deck-link-hint {
    margin-top: 6px;
}

.deck-pinned #import-deck-btn,
.deck-pinned #new-deck-btn,
.deck-pinned #delete-deck-btn {
    display: none;
}

.deck-pinned .deck-select {
    background-image: none;
    padding-right: 10px;
    cursor: default;
    color: var(--text);
    opacity: 1;
}

.sync-error-panel {
    background: rgba(231, 76, 60, 0.1);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(231, 76, 60, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-error-icon {
    font-size: 16px;
    color: #c0392b;
}

.sync-error-message {
    font-size: 11px;
    color: #c0392b;
    flex: 1;
}

.setting-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cute-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.cute-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-color: var(--primary-lighter);
    transition: .2s;
    border-radius: 14px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--white);
    transition: .2s;
    border-radius: 50%;
}

.cute-toggle input:checked + .toggle-slider {
    background-color: var(--primary);
}

.cute-toggle input:checked + .toggle-slider:before {
    transform: translateX(14px);
}




html.hide-border .y2k-window {
    border: none !important;
}

html.hide-border .y2k-title-bar {
    border-bottom-color: transparent !important;
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);

    color: var(--primary);
    font-size: 11px;
    font-weight: 600;

    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


[data-shape="square"] {
    --card-border-radius: 0px;
}

[data-shape="square"] .deck-select,
[data-shape="square"] .scale-slider,
[data-shape="square"] .toast {
    border-radius: 0;
}

[data-shape="square"] .card-content-editable img {
    border-radius: 0;
}

[data-shape="square"] #sync-code-input {
    border-radius: 0;
}

.window-style-toggle .window-style-btn.active {
    color: var(--on-accent, var(--white));
}


.sync-section > .share-link-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.settings-panel.active {
    display: flex;
    flex-direction: column;
}

.settings-panel > .settings-header {
    flex-shrink: 0;
    margin: 12px 16px 0 12px;
}

.settings-panel > .settings-content {
    min-height: 0;
    scrollbar-gutter: stable;
}

.settings-panel .window-style-btn {
    text-box: trim-both cap alphabetic;
    height: 25px;
    padding-top: 0;
    padding-bottom: 0;
    padding-bottom: calc((1cap - 1ex) / 2);
}

@container style(--font-family: 'Imprima', sans-serif) {
    .settings-panel .window-style-btn {
        padding-bottom: calc((1cap - 1ex) / 2 - 0.5px);
    }
}
