/*
Theme Name: 랜덤숫자뽑기
Theme URI: https://www.rand3.com
Author: Rand3
Author URI: https://www.rand3.com
Description: 랜덤숫자뽑기 - 다양한 랜덤 생성 도구 모음 사이트 테마
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rand3-theme
Tags: random, number, generator, tools
*/

/* ============================================
   ROOT VARIABLES & RESET
============================================ */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f59e0b;
    --secondary-dark: #d97706;
    --accent-color: #10b981;
    --accent-dark: #059669;
    --danger-color: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    --shadow-glow-accent: 0 0 20px rgba(16, 185, 129, 0.3);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

/* ============================================
   LAYOUT
============================================ */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ============================================
   HEADER & NAVIGATION
============================================ */
.site-header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.site-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.main-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.mobile-menu-toggle {
    display: none;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 50%, var(--bg-card) 100%);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-box {
    display: flex;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.search-box input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.125rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    padding: 1rem 2rem;
    background: var(--primary-color);
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-box button:hover {
    background: var(--primary-dark);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   CATEGORY GRID
============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--category-color, var(--primary-color));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--category-color, var(--primary-color));
    box-shadow: var(--shadow-xl);
}

.category-card:hover::before {
    opacity: 1;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--category-color, var(--primary-color)), var(--category-color-dark, var(--primary-dark)));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.category-title {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.category-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.category-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Category Colors */
.category-card[data-category="numbers"] { --category-color: #6366f1; --category-color-dark: #4f46e5; }
.category-card[data-category="lotto"] { --category-color: #f59e0b; --category-color-dark: #d97706; }
.category-card[data-category="games"] { --category-color: #ef4444; --category-color-dark: #dc2626; }
.category-card[data-category="teams"] { --category-color: #10b981; --category-color-dark: #059669; }
.category-card[data-category="datetime"] { --category-color: #8b5cf6; --category-color-dark: #7c3aed; }
.category-card[data-category="text"] { --category-color: #06b6d4; --category-color-dark: #0891b2; }
.category-card[data-category="colors"] { --category-color: #ec4899; --category-color-dark: #db2777; }
.category-card[data-category="decision"] { --category-color: #84cc16; --category-color-dark: #65a30d; }
.category-card[data-category="data"] { --category-color: #14b8a6; --category-color-dark: #0d9488; }
.category-card[data-category="fun"] { --category-color: #f97316; --category-color-dark: #ea580c; }

/* ============================================
   TOOL CARDS
============================================ */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.tool-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tool-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-title {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    flex: 1;
}

.tool-actions {
    display: flex;
    gap: 0.5rem;
}

.tool-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-align: center;
}

.tool-btn-primary {
    background: var(--primary-color);
    color: white;
}

.tool-btn-primary:hover {
    background: var(--primary-dark);
}

.tool-btn-secondary {
    background: var(--bg-dark);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tool-btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ============================================
   TOOL WORKSPACE
============================================ */
.tool-workspace {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    margin-bottom: 2rem;
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.workspace-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.workspace-title .icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.workspace-controls {
    display: grid;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.control-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Form Elements */
.form-input,
.form-select,
.form-textarea {
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-sm {
    width: 120px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-dark);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ============================================
   RESULT DISPLAY
============================================ */
.result-area {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.result-display {
    background: linear-gradient(135deg, var(--bg-dark), #1a1a2e);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.result-display::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    animation: rotate 10s linear infinite;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.result-display.active::before {
    opacity: 1;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.result-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1.2;
    word-break: break-all;
    position: relative;
    z-index: 1;
}

.result-value.text-sm {
    font-size: 1.5rem;
}

.result-value.text-xs {
    font-size: 1rem;
    font-weight: 600;
}

.result-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.result-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    animation: popIn 0.3s ease forwards;
    opacity: 0;
    transform: scale(0);
}

.result-number:nth-child(1) { animation-delay: 0.0s; }
.result-number:nth-child(2) { animation-delay: 0.1s; }
.result-number:nth-child(3) { animation-delay: 0.2s; }
.result-number:nth-child(4) { animation-delay: 0.3s; }
.result-number:nth-child(5) { animation-delay: 0.4s; }
.result-number:nth-child(6) { animation-delay: 0.5s; }
.result-number:nth-child(7) { animation-delay: 0.6s; }
.result-number:nth-child(8) { animation-delay: 0.7s; }
.result-number:nth-child(9) { animation-delay: 0.8s; }
.result-number:nth-child(10) { animation-delay: 0.9s; }

@keyframes popIn {
    0% { opacity: 0; transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

.result-number.bonus {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* History */
.result-history {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.history-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.history-item .value {
    font-weight: 600;
    color: var(--text-primary);
}

.history-item .time {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================
   LOTTO SPECIFIC STYLES
============================================ */
.lotto-numbers {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.lotto-ball {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    box-shadow: inset 0 -3px 10px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.2);
    animation: popIn 0.3s ease forwards;
    opacity: 0;
    transform: scale(0);
}

.lotto-ball.range-1-10 { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.lotto-ball.range-11-20 { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.lotto-ball.range-21-30 { background: linear-gradient(135deg, #f87171, #ef4444); }
.lotto-ball.range-31-40 { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.lotto-ball.range-41-45 { background: linear-gradient(135deg, #34d399, #10b981); }
.lotto-ball.bonus {
    background: linear-gradient(135deg, #f472b6, #ec4899);
    position: relative;
}
.lotto-ball.bonus::before {
    content: '+';
    position: absolute;
    left: -20px;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* ============================================
   WHEEL SPINNER
============================================ */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid var(--primary-color);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    z-index: 5;
}

/* ============================================
   DICE
============================================ */
.dice-container {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dice {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: transform 0.5s ease;
}

.dice.rolling {
    animation: rollDice 0.5s ease infinite;
}

@keyframes rollDice {
    0%, 100% { transform: rotateX(0) rotateY(0); }
    25% { transform: rotateX(90deg) rotateY(45deg); }
    50% { transform: rotateX(180deg) rotateY(90deg); }
    75% { transform: rotateX(270deg) rotateY(135deg); }
}

.dice-dot {
    width: 16px;
    height: 16px;
    background: #1a1a2e;
    border-radius: 50%;
    justify-self: center;
    align-self: center;
    opacity: 0;
}

.dice-dot.visible {
    opacity: 1;
}

/* ============================================
   COIN FLIP
============================================ */
.coin {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1s ease;
    margin: 0 auto;
}

.coin.flipping {
    animation: flipCoin 1s ease;
}

@keyframes flipCoin {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(1800deg); }
}

.coin-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    backface-visibility: hidden;
    box-shadow: inset 0 0 30px rgba(0,0,0,0.3);
}

.coin-heads {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
    color: #92400e;
}

.coin-tails {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #1e293b;
    transform: rotateY(180deg);
}

/* ============================================
   TEAM DIVIDER
============================================ */
.teams-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.team-box {
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all var(--transition-fast);
}

.team-box:hover {
    border-color: var(--team-color, var(--primary-color));
}

.team-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.team-badge {
    width: 36px;
    height: 36px;
    background: var(--team-color, var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.team-name {
    font-weight: 600;
    color: var(--text-primary);
}

.team-members {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.team-member {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   LADDER GAME
============================================ */
.ladder-game {
    position: relative;
    padding: 2rem;
}

.ladder-players {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
}

.ladder-player {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: white;
    text-align: center;
    min-width: 80px;
}

.ladder-svg {
    width: 100%;
    height: 300px;
}

.ladder-results {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.ladder-result {
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: white;
    text-align: center;
    min-width: 80px;
}

/* ============================================
   COLOR PALETTE
============================================ */
.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 1rem;
}

.color-swatch {
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
}

.color-swatch:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.color-swatch::after {
    content: attr(data-color);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 0.625rem;
    text-align: center;
    font-family: monospace;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.color-swatch:hover::after {
    opacity: 1;
}

/* ============================================
   PASSWORD GENERATOR
============================================ */
.password-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.password-text {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 1.25rem;
    color: var(--text-primary);
    word-break: break-all;
}

.password-copy {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.password-copy:hover {
    background: var(--primary-dark);
}

.password-strength {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    transition: background var(--transition-fast);
}

.strength-bar.weak { background: #ef4444; }
.strength-bar.fair { background: #f59e0b; }
.strength-bar.good { background: #84cc16; }
.strength-bar.strong { background: #10b981; }

/* ============================================
   TAGS INPUT
============================================ */
.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    min-height: 100px;
    align-content: flex-start;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    animation: tagPop 0.2s ease;
}

@keyframes tagPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.tag-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.tag-remove:hover {
    color: white;
}

.tags-input {
    flex: 1;
    min-width: 120px;
    background: none;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 0.875rem;
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-brand .logo .icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   ADSENSE PLACEHOLDERS
============================================ */
.ad-container {
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    margin: 1.5rem 0;
}

.ad-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.ad-horizontal {
    min-height: 90px;
}

.ad-vertical {
    min-height: 250px;
}

.ad-square {
    min-height: 250px;
    max-width: 300px;
    margin: 0 auto;
}

/* ============================================
   ANTIGRAVITY EFFECTS
============================================ */
.antigravity-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.antigravity-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.antigravity-glow {
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6); }
}

.antigravity-spin {
    animation: spin 20s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.antigravity-bounce {
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.antigravity-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.antigravity-fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.antigravity-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 2rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        padding: 1rem;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .tool-workspace {
        padding: 1.5rem;
    }

    .result-value {
        font-size: 2rem;
    }

    .result-number,
    .lotto-ball {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .control-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-input-sm {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .section {
        padding: 2rem 0;
    }

    .btn {
        padding: 0.75rem 1.25rem;
    }

    .tool-card {
        padding: 1rem;
    }

    .category-card {
        padding: 1rem;
    }

    .wheel-container {
        width: 250px;
        height: 250px;
    }

    .dice {
        width: 60px;
        height: 60px;
    }

    .coin {
        width: 120px;
        height: 120px;
    }
}

/* ============================================
   PRINT STYLES
============================================ */
@media print {
    .site-header,
    .site-footer,
    .ad-container,
    .antigravity-particles {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .result-display {
        border: 1px solid #ccc;
    }
}

/* ============================================
   ACCESSIBILITY
============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   LOADING STATES
============================================ */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   TOAST NOTIFICATIONS
============================================ */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: var(--accent-color);
}

.toast.error {
    border-color: var(--danger-color);
}

.toast.info {
    border-color: var(--primary-color);
}
