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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 10px;
    font-size: 26px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

h2 {
    color: #333;
    margin: 25px 0 15px 0;
    font-size: 18px;
}

.setup-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    flex: 1;
    transition: border-color 0.3s;
}

input:focus {
    outline: none;
    border-color: #667eea;
}

.setup-section button, .start-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    font-weight: bold;
}

.setup-section button:hover, .start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #222 0%, #444 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.start-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.hint {
    color: #999;
    font-size: 13px;
    margin-top: 8px;
}

.menu-list {
    margin-top: 20px;
}

.menu-list ul {
    list-style: none;
}

.empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #999;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.empty-state p {
    margin: 5px 0;
}

.menu-list li {
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    margin: 8px 0;
    border-radius: 10px;
    border-left: 4px solid #333;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.menu-list li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.menu-list li .menu-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-list li .menu-number {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
}

.menu-list li .menu-name {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.delete-btn {
    background: linear-gradient(135deg, #666 0%, #888 100%);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.delete-btn:hover {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

#menu-count {
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.game-section {
    text-align: center;
    margin: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.start-btn {
    padding: 15px 40px;
    font-size: 18px;
    border-radius: 10px;
}

.edit-btn {
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #555 0%, #777 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #444 0%, #666 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.edit-section {
    display: none;
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px solid #ddd;
}

.edit-section.active {
    display: block;
}

.edit-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

.edit-menu-list {
    margin: 20px 0;
}

.edit-menu-item {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    align-items: center;
}

.edit-menu-item input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.edit-menu-item button {
    padding: 8px 15px;
    background: linear-gradient(135deg, #666 0%, #888 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.edit-menu-item button:hover {
    background: linear-gradient(135deg, #555 0%, #777 100%);
}

.add-menu-row {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.add-menu-row input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.add-menu-row button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.save-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #222 0%, #444 100%);
}

.game-area {
    display: none;
    margin-top: 30px;
    text-align: center;
}

.game-area.active {
    display: block;
}

.start-selection {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
}

.start-selection h2 {
    margin-bottom: 15px;
    color: #333;
}

.menu-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.menu-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.menu-button.selected {
    background: linear-gradient(135deg, #222 0%, #444 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid #666;
}

#ladder-canvas {
    border: 2px solid #ddd;
    border-radius: 10px;
    background-color: #fff;
    margin: 0 auto;
    display: block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.game-result {
    margin-top: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    display: none;
    text-align: center;
}

.game-result.active {
    display: block;
    animation: fadeIn 0.5s;
}

.result-title {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.result-menu {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.result-note {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

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